mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 05:43:11 +00:00
fish_opt completion (#8433)
* Basic fish_opt completion * Condition for -o and -r fish_opt options * Change -g to --local * Enhance readability * Add --require-parameter * Add --no-files for -s|-l options
This commit is contained in:
parent
47e45704b1
commit
f87395f5e9
1 changed files with 12 additions and 0 deletions
12
share/completions/fish_opt.fish
Normal file
12
share/completions/fish_opt.fish
Normal file
|
@ -0,0 +1,12 @@
|
|||
set --local CONDITION '! __fish_seen_argument --short r --long required-val --short o --long optional-val'
|
||||
|
||||
complete --command fish_opt --no-files
|
||||
|
||||
complete --command fish_opt --short-option h --long-option help --description 'Show help'
|
||||
|
||||
complete --command fish_opt --short-option s --long-option short --no-files --require-parameter --description 'Specify short option'
|
||||
complete --command fish_opt --short-option l --long-option long --no-files --require-parameter --description 'Specify long option'
|
||||
complete --command fish_opt --long-option longonly --description 'Use only long option'
|
||||
complete --command fish_opt --short-option o --long-option optional-val -n $CONDITION --description 'Don\'t require value'
|
||||
complete --command fish_opt --short-option r --long-option required-val -n $CONDITION --description 'Require value'
|
||||
complete --command fish_opt --long-option multiple-vals --description 'Store all values'
|
Loading…
Reference in a new issue