From b068badfa14cf8cb084a385d07774ab65973f733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20FARKAS?= Date: Mon, 9 Oct 2023 06:24:47 +0200 Subject: [PATCH] Add Nushell completion script (#1571) --- bin/generate-completions | 3 +++ completions/just.nu | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 completions/just.nu diff --git a/bin/generate-completions b/bin/generate-completions index dfcc4de89c..9b5a357832 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 0000000000..82b7266590 --- /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) +]