Skip to content

Commit

Permalink
Add Nushell completion script (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
presidento authored Oct 9, 2023
1 parent 41c52f9 commit b068bad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/generate-completions
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 8 additions & 0 deletions completions/just.nu
Original file line number Diff line number Diff line change
@@ -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)
]

0 comments on commit b068bad

Please sign in to comment.