File tree 1 file changed +11
-0
lines changed
needs-update/custom-completions/auto-generate 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,16 @@ def build-completions-from-pwd [] {
11
11
}
12
12
}
13
13
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
+
14
24
# build a completion form a .fish file and generate a .nu file
15
25
def build-completion [fish_file : path , nu_file : path ] {
16
26
open $fish_file | parse-fish | make-commands-completion | str join " \n\n " | save $nu_file
@@ -104,6 +114,7 @@ def cleanup_subcommands [] {
104
114
def make-commands-completion [] {
105
115
let fishes = $in
106
116
$fishes
117
+ | where ' command' in ($fishes | columns )
107
118
| get command
108
119
| uniq # command is cloned on every complete line
109
120
| each { |command |
You can’t perform that action at this time.
0 commit comments