File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
needs-update/custom-completions/auto-generate Expand file tree Collapse file tree 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 [] {
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
1525def 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 [] {
104114def 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 |
You can’t perform that action at this time.
0 commit comments