diff options
author | Máté FARKAS <presidento@farkas-mate.hu> | 2023-10-09 06:24:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-08 21:24:47 -0700 |
commit | b068badfa14cf8cb084a385d07774ab65973f733 (patch) | |
tree | 63b42524faa0b72ce11a995dc905f7b3efb9e7a5 | |
parent | 41c52f9ade50c3224f89a38c8f4b36f96aa03a9a (diff) |
Add Nushell completion script (#1571)
-rwxr-xr-x | bin/generate-completions | 3 | ||||
-rw-r--r-- | completions/just.nu | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/bin/generate-completions b/bin/generate-completions index dfcc4de8..9b5a3578 100755 --- a/bin/generate-completions +++ b/bin/generate-completions @@ -4,5 +4,8 @@ set -euxo pipefail for script in completions/*; do shell=${script##*.} + if [ $shell == nu ]; then + continue + fi cargo run -- --completions $shell > $script done diff --git a/completions/just.nu b/completions/just.nu new file mode 100644 index 00000000..82b72665 --- /dev/null +++ b/completions/just.nu @@ -0,0 +1,8 @@ +def "nu-complete just" [] {
+ (^just --dump --unstable --dump-format json | from json).recipes | transpose recipe data | flatten | where {|row| $row.private == false } | select recipe doc parameters | rename value description
+}
+
+# Just: A Command Runner
+export extern "just" [
+ ...recipe: string@"nu-complete just", # Recipe(s) to run, may be with argument(s)
+]
|