feat(completion): use local-scoped variables

This commit is contained in:
EmilyGraceSeville7cf 2024-09-18 04:11:57 +10:00
parent 47aff2ea65
commit efade08459
4 changed files with 7 additions and 7 deletions

View file

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

View file

@ -1,4 +1,4 @@
set command boon
set -l command boon
complete -c $command -f

View file

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

View file

@ -1,4 +1,4 @@
set command jv
set -l command jv
complete -c $command -f