Skip to content

Commit 2bccba6

Browse files
j-xellaalex
andauthored
various improvements to completions for just (#1166)
Tested with just 1.42.4 See each commit comments for more details. --------- Co-authored-by: alex <alex@main-dell>
1 parent e702d5a commit 2bccba6

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

custom-completions/just/just-completions.nu

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ def "nu-complete just assignments" [] {
7575
}}
7676
}
7777

78+
# Just: A Command Runner. A handy way to save and run project-specific commands.
7879
export extern "just" [
7980
recipe?:string@"nu-complete just" # Recipe to execute
80-
...args:any@"nu-complete args" # Arguments
8181
--changelog # Print changelog
8282
--check # Run `--fmt` in 'check' mode. Exits with 0 if justfile is formatted correctly. Exits with 1 and prints a diff if formatting is required.
8383
--choose # Select one or more recipes to run using a binary chooser. If `--chooser` is not passed the chooser defaults to the value of $JUST_CHOOSER, falling back to `fzf`
@@ -86,17 +86,25 @@ export extern "just" [
8686
--dump # Print justfile
8787
--edit(-e) # Edit justfile with editor given by $VISUAL or $EDITOR, falling back to `vim`
8888
--evaluate # Evaluate and print all variables. If a variable name is given as an argument, only print that variable's value.
89+
--explain # Print recipe doc comment before running it
8990
--fmt # Format and overwrite justfile
91+
--global-justfile(-g) # Use global justfile
92+
--groups # List recipe groups
9093
--highlight # Highlight echoed recipe lines in bold
9194
--init # Initialize new justfile in project root
9295
--list(-l) # List available recipes and their arguments
96+
--man # Print man page
9397
--no-aliases # Don't show aliases in list
9498
--no-deps # Don't run recipe dependencies
9599
--no-dotenv # Don't load `.env` file
96100
--no-highlight # Don't highlight echoed recipe lines in bold
101+
--one # Forbid multiple recipes from being invoked on the command line
97102
--quiet(-q) # Suppress all output
98103
--shell-command # Invoke <COMMAND> with the shell used to run recipe lines and backticks
99104
--summary # List names of available recipes
105+
--tempdir:glob # Save temporary files to <TEMPDIR>.
106+
--timestamp # Print recipe command timestamps
107+
--timestamp-format:string # Timestamp format string
100108
--unsorted(-u) # Return list and summary entries in source order
101109
--unstable # Enable unstable features
102110
--variables # List names of variables
@@ -105,31 +113,37 @@ export extern "just" [
105113
--help(-h) # Print help information
106114
--version(-V) # Print version information
107115

108-
--chooser # Override binary invoked by `--choose`
116+
--alias-style:string@"nu-complete just al-st" # Set list command alias display style
117+
--chooser:string # Override binary invoked by `--choose`
109118
--color:string@"nu-complete just color-when" # Print colorful output [default: auto] [possible values: auto, always, never]
110-
--command(-c) # Run an arbitrary command with the working directory, `.env`, overrides, and exports set
119+
--command(-c):string # Run an arbitrary command with the working directory, `.env`, overrides, and exports set
111120
--command-color:string@"nu-complete just color" # Echo recipe lines in <COMMAND-COLOR> [possible values: black, blue, cyan, green, purple, red, yellow]
112-
--completions:string@"nu-complete just shells" # Print shell completion script for <SHELL> [possible values: zsh, bash, fish, powershell, elvish]
113-
--dotenv-filename # Search for environment file named <DOTENV-FILENAME> instead of `.env`
114-
--dotenv-path(-E) # Load <DOTENV-PATH> as environment file instead of searching for one
121+
--completions:string@"nu-complete just shells" # Print shell completion script for <SHELL> [possible values: zsh, bash, fish, powershell, elvish, nushell]
122+
--dotenv-filename:glob # Search for environment file named <DOTENV-FILENAME> instead of `.env`
123+
--dotenv-path(-E):glob # Load <DOTENV-PATH> as environment file instead of searching for one
115124
--dump-format:string@"nu-complete just format" # Dump justfile as <FORMAT> [default: just] [possible values: just, json]
116-
--justfile(-f) # Use <JUSTFILE> as justfile
117-
--list-heading # Print <TEXT> before list
118-
--list-prefix # Print <TEXT> before each list item
125+
--justfile(-f):glob # Use <JUSTFILE> as justfile
126+
--list-heading:string # Print <TEXT> before list
127+
--list-prefix:string # Print <TEXT> before each list item
128+
--list-submodules # List recipes in submodules
119129
--set:string@"nu-complete just assignments" # Override <VARIABLE> with <VALUE>
120130
--shell:string@"nu-complete just shells" # Invoke <SHELL> to run recipes
121-
--shell-arg # Invoke shell with <SHELL-ARG> as an argument
131+
--shell-arg:string # Invoke shell with <SHELL-ARG> as an argument
122132
--show(-s):string@"nu-complete just" # Show information about <RECIPE>
123-
--working-directory(-d) # Use <WORKING-DIRECTORY> as working directory. --justfile must also be set
133+
--working-directory(-d):glob # Use <WORKING-DIRECTORY> as working directory. --justfile must also be set
124134
]
125135

136+
def "nu-complete just al-st" [] {
137+
[ "left", "right", "separate" ]
138+
}
139+
126140
def "nu-complete just format" [] {
127141
[ "just", "json" ]
128142
}
129143

130144
# Shells as listed in `--completions`
131145
def "nu-complete just shells" [] {
132-
[ "zsh", "bash", "fish", "powershell", "elvish" ]
146+
[ "zsh", "bash", "fish", "powershell", "elvish", "nushell" ]
133147
}
134148

135149
# Color outputs as listed in `--color`

0 commit comments

Comments
 (0)