mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-14 00:47:30 +00:00
feat(completion): use local-scoped variables
This commit is contained in:
parent
47aff2ea65
commit
efade08459
4 changed files with 7 additions and 7 deletions
|
@ -1,20 +1,20 @@
|
|||
set command ajv
|
||||
set -l command ajv
|
||||
|
||||
complete -c $command -f
|
||||
|
||||
set subcommands_with_descriptions 'validate\t"Validate the files against a schema"' \
|
||||
set -l subcommands_with_descriptions 'validate\t"Validate the files against a schema"' \
|
||||
'compile\t"Compile the schema"' \
|
||||
'migrate\t"Migrate the schemas"' \
|
||||
'test\t"Check whether the files are valid against a schema"' \
|
||||
'help\t"Show help"'
|
||||
|
||||
set subcommands (string replace --regex '\\\t.+' '' -- $subcommands_with_descriptions)
|
||||
set -l subcommands (string replace --regex '\\\t.+' '' -- $subcommands_with_descriptions)
|
||||
|
||||
complete -c $command \
|
||||
-a "$subcommands_with_descriptions" \
|
||||
-n "not __fish_seen_subcommand_from $subcommands"
|
||||
|
||||
set subcommands_without_help $subcommands[1..-2]
|
||||
set -l subcommands_without_help $subcommands[1..-2]
|
||||
|
||||
complete -c $command -s s -F -r \
|
||||
-d 'The [s]chema used for a validation' \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
set command boon
|
||||
set -l command boon
|
||||
|
||||
complete -c $command -f
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
set command json_schemer
|
||||
set -l command json_schemer
|
||||
|
||||
complete -c $command -s h -l help -d 'Show [h]elp'
|
||||
complete -c $command -s v -l version -d 'Show [v]ersion'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
set command jv
|
||||
set -l command jv
|
||||
|
||||
complete -c $command -f
|
||||
|
||||
|
|
Loading…
Reference in a new issue