Skip to content

Commit 1c16bac

Browse files
committed
Add missing command col exists check
1 parent 24c4d59 commit 1c16bac

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

needs-update/custom-completions/auto-generate/parse-fish.nu

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ def build-completions-from-pwd [] {
1111
}
1212
}
1313

14+
# parse every .fish file in the source_dir directory and make a .nu completions file of it in target_dir
15+
def build-completions [source: path, target_dir: path] {
16+
glob $source
17+
| par-each { |src|
18+
let out = ($src | path parse | update extension 'nu' | path join)
19+
print $"building nushell completions from ($src) into ($out)…"
20+
build-completion $src $out
21+
}
22+
}
23+
1424
# build a completion form a .fish file and generate a .nu file
1525
def build-completion [fish_file: path, nu_file: path] {
1626
open $fish_file | parse-fish | make-commands-completion | str join "\n\n" | save $nu_file
@@ -104,6 +114,7 @@ def cleanup_subcommands [] {
104114
def make-commands-completion [] {
105115
let fishes = $in
106116
$fishes
117+
| where 'command' in ($fishes | columns)
107118
| get command
108119
| uniq # command is cloned on every complete line
109120
| each { |command|

0 commit comments

Comments
 (0)