Add Nushell completion script (#1571)

This commit is contained in:
Máté FARKAS 2023-10-09 06:24:47 +02:00 committed by GitHub
parent 41c52f9ade
commit b068badfa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -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

8
completions/just.nu Normal file
View File

@ -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)
]