test(complete): Disable normalization of \ to /

This allows easier testing, as the generated completion files can be
sourced directly.
This commit is contained in:
Roland Fredenhagen 2022-09-02 14:35:12 +02:00
parent 5e69f92efc
commit 028a4cd0dc
No known key found for this signature in database
GPG key ID: 094AF99241035EB6
12 changed files with 267 additions and 266 deletions

View file

@ -258,5 +258,6 @@ pub fn assert_matches_path(
snapbox::Assert::new()
.action_env("SNAPSHOTS")
.normalize_paths(false)
.matches_path(expected_path, buf);
}

View file

@ -14,20 +14,20 @@ _my-app() {
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" /
'*-o+[cmd option]: : ' /
'*-O+[cmd option]: : ' /
'*--option=[cmd option]: : ' /
'*--opt=[cmd option]: : ' /
'*-f[cmd flag]' /
'*-F[cmd flag]' /
'*--flag[cmd flag]' /
'*--flg[cmd flag]' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
'::positional:' /
_arguments "${_arguments_options[@]}" \
'*-o+[cmd option]: : ' \
'*-O+[cmd option]: : ' \
'*--option=[cmd option]: : ' \
'*--opt=[cmd option]: : ' \
'*-f[cmd flag]' \
'*-F[cmd flag]' \
'*--flag[cmd flag]' \
'*--flg[cmd flag]' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
'::positional:' \
&& ret=0
}

View file

@ -14,13 +14,13 @@ _my-app() {
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" /
'*-c[]' /
'(-c)*-v[]' /
'*-h[Print help information]' /
'*--help[Print help information]' /
":: :_my-app_commands" /
"*::: :->my-app" /
_arguments "${_arguments_options[@]}" \
'*-c[]' \
'(-c)*-v[]' \
'*-h[Print help information]' \
'*--help[Print help information]' \
":: :_my-app_commands" \
"*::: :->my-app" \
&& ret=0
case $state in
(my-app)
@ -29,17 +29,17 @@ _my-app() {
curcontext="${curcontext%:*:*}:my-app-command-$line[1]:"
case $line[1] in
(test)
_arguments "${_arguments_options[@]}" /
'*-d[]' /
'*-c[]' /
'*-h[Print help information]' /
'*--help[Print help information]' /
_arguments "${_arguments_options[@]}" \
'*-d[]' \
'*-c[]' \
'*-h[Print help information]' \
'*--help[Print help information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
":: :_my-app__help_commands" /
"*::: :->help" /
_arguments "${_arguments_options[@]}" \
":: :_my-app__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
@ -49,11 +49,11 @@ _arguments "${_arguments_options[@]}" /
curcontext="${curcontext%:*:*}:my-app-help-command-$line[1]:"
case $line[1] in
(test)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
@ -68,16 +68,16 @@ esac
(( $+functions[_my-app_commands] )) ||
_my-app_commands() {
local commands; commands=(
'test:Subcommand' /
'help:Print this message or the help of the given subcommand(s)' /
'test:Subcommand' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app commands' commands "$@"
}
(( $+functions[_my-app__help_commands] )) ||
_my-app__help_commands() {
local commands; commands=(
'test:Subcommand' /
'help:Print this message or the help of the given subcommand(s)' /
'test:Subcommand' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app help commands' commands "$@"
}

View file

@ -14,19 +14,19 @@ _my-app() {
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" /
'*-c[some config file]' /
'*-C[some config file]' /
'*--config[some config file]' /
'*--conf[some config file]' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
'::file -- some input file:_files' /
'::choice:(first second)' /
":: :_my-app_commands" /
"*::: :->my-app" /
_arguments "${_arguments_options[@]}" \
'*-c[some config file]' \
'*-C[some config file]' \
'*--config[some config file]' \
'*--conf[some config file]' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
'::file -- some input file:_files' \
'::choice:(first second)' \
":: :_my-app_commands" \
"*::: :->my-app" \
&& ret=0
case $state in
(my-app)
@ -35,18 +35,18 @@ _my-app() {
curcontext="${curcontext%:*:*}:my-app-command-$line[3]:"
case $line[3] in
(test)
_arguments "${_arguments_options[@]}" /
'*--case=[the case to test]: : ' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
_arguments "${_arguments_options[@]}" \
'*--case=[the case to test]: : ' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
":: :_my-app__help_commands" /
"*::: :->help" /
_arguments "${_arguments_options[@]}" \
":: :_my-app__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
@ -56,11 +56,11 @@ _arguments "${_arguments_options[@]}" /
curcontext="${curcontext%:*:*}:my-app-help-command-$line[1]:"
case $line[1] in
(test)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
@ -75,16 +75,16 @@ esac
(( $+functions[_my-app_commands] )) ||
_my-app_commands() {
local commands; commands=(
'test:tests things' /
'help:Print this message or the help of the given subcommand(s)' /
'test:tests things' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app commands' commands "$@"
}
(( $+functions[_my-app__help_commands] )) ||
_my-app__help_commands() {
local commands; commands=(
'test:tests things' /
'help:Print this message or the help of the given subcommand(s)' /
'test:tests things' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app help commands' commands "$@"
}

View file

@ -21,7 +21,7 @@ set edit:completion:arg-completer[my-app] = {|@words|
cand --single-quotes 'Can be ''always'', ''auto'', or ''never'''
cand --double-quotes 'Can be "always", "auto", or "never"'
cand --backticks 'For more information see `echo test`'
cand --backslash 'Avoid ''/n'''
cand --backslash 'Avoid ''\n'''
cand --brackets 'List packages [filter]'
cand --expansions 'Execute the shell command with $SHELL'
cand -h 'Print help information'
@ -31,7 +31,7 @@ set edit:completion:arg-completer[my-app] = {|@words|
cand cmd-single-quotes 'Can be ''always'', ''auto'', or ''never'''
cand cmd-double-quotes 'Can be "always", "auto", or "never"'
cand cmd-backticks 'For more information see `echo test`'
cand cmd-backslash 'Avoid ''/n'''
cand cmd-backslash 'Avoid ''\n'''
cand cmd-brackets 'List packages [filter]'
cand cmd-expansions 'Execute the shell command with $SHELL'
cand help 'Print this message or the help of the given subcommand(s)'
@ -64,7 +64,7 @@ set edit:completion:arg-completer[my-app] = {|@words|
cand cmd-single-quotes 'Can be ''always'', ''auto'', or ''never'''
cand cmd-double-quotes 'Can be "always", "auto", or "never"'
cand cmd-backticks 'For more information see `echo test`'
cand cmd-backslash 'Avoid ''/n'''
cand cmd-backslash 'Avoid ''\n'''
cand cmd-brackets 'List packages [filter]'
cand cmd-expansions 'Execute the shell command with $SHELL'
cand help 'Print this message or the help of the given subcommand(s)'

View file

@ -1,15 +1,15 @@
complete -c my-app -n "__fish_use_subcommand" -l single-quotes -d 'Can be /'always/', /'auto/', or /'never/''
complete -c my-app -n "__fish_use_subcommand" -l single-quotes -d 'Can be \'always\', \'auto\', or \'never\''
complete -c my-app -n "__fish_use_subcommand" -l double-quotes -d 'Can be "always", "auto", or "never"'
complete -c my-app -n "__fish_use_subcommand" -l backticks -d 'For more information see `echo test`'
complete -c my-app -n "__fish_use_subcommand" -l backslash -d 'Avoid /'//n/''
complete -c my-app -n "__fish_use_subcommand" -l backslash -d 'Avoid \'\\n\''
complete -c my-app -n "__fish_use_subcommand" -l brackets -d 'List packages [filter]'
complete -c my-app -n "__fish_use_subcommand" -l expansions -d 'Execute the shell command with $SHELL'
complete -c my-app -n "__fish_use_subcommand" -s h -l help -d 'Print help information'
complete -c my-app -n "__fish_use_subcommand" -s V -l version -d 'Print version information'
complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-single-quotes" -d 'Can be /'always/', /'auto/', or /'never/''
complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-single-quotes" -d 'Can be \'always\', \'auto\', or \'never\''
complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-double-quotes" -d 'Can be "always", "auto", or "never"'
complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-backticks" -d 'For more information see `echo test`'
complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-backslash" -d 'Avoid /'//n/''
complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-backslash" -d 'Avoid \'\\n\''
complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-brackets" -d 'List packages [filter]'
complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-expansions" -d 'Execute the shell command with $SHELL'
complete -c my-app -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
@ -19,10 +19,10 @@ complete -c my-app -n "__fish_seen_subcommand_from cmd-backticks" -s h -l help -
complete -c my-app -n "__fish_seen_subcommand_from cmd-backslash" -s h -l help -d 'Print help information'
complete -c my-app -n "__fish_seen_subcommand_from cmd-brackets" -s h -l help -d 'Print help information'
complete -c my-app -n "__fish_seen_subcommand_from cmd-expansions" -s h -l help -d 'Print help information'
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-single-quotes" -d 'Can be /'always/', /'auto/', or /'never/''
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-single-quotes" -d 'Can be \'always\', \'auto\', or \'never\''
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-double-quotes" -d 'Can be "always", "auto", or "never"'
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backticks" -d 'For more information see `echo test`'
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backslash" -d 'Avoid /'//n/''
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-backslash" -d 'Avoid \'\\n\''
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-brackets" -d 'List packages [filter]'
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "cmd-expansions" -d 'Execute the shell command with $SHELL'
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from cmd-single-quotes; and not __fish_seen_subcommand_from cmd-double-quotes; and not __fish_seen_subcommand_from cmd-backticks; and not __fish_seen_subcommand_from cmd-backslash; and not __fish_seen_subcommand_from cmd-brackets; and not __fish_seen_subcommand_from cmd-expansions; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'

View file

@ -24,7 +24,7 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
[CompletionResult]::new('--single-quotes', 'single-quotes', [CompletionResultType]::ParameterName, 'Can be ''always'', ''auto'', or ''never''')
[CompletionResult]::new('--double-quotes', 'double-quotes', [CompletionResultType]::ParameterName, 'Can be "always", "auto", or "never"')
[CompletionResult]::new('--backticks', 'backticks', [CompletionResultType]::ParameterName, 'For more information see `echo test`')
[CompletionResult]::new('--backslash', 'backslash', [CompletionResultType]::ParameterName, 'Avoid ''/n''')
[CompletionResult]::new('--backslash', 'backslash', [CompletionResultType]::ParameterName, 'Avoid ''\n''')
[CompletionResult]::new('--brackets', 'brackets', [CompletionResultType]::ParameterName, 'List packages [filter]')
[CompletionResult]::new('--expansions', 'expansions', [CompletionResultType]::ParameterName, 'Execute the shell command with $SHELL')
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
@ -34,7 +34,7 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
[CompletionResult]::new('cmd-single-quotes', 'cmd-single-quotes', [CompletionResultType]::ParameterValue, 'Can be ''always'', ''auto'', or ''never''')
[CompletionResult]::new('cmd-double-quotes', 'cmd-double-quotes', [CompletionResultType]::ParameterValue, 'Can be "always", "auto", or "never"')
[CompletionResult]::new('cmd-backticks', 'cmd-backticks', [CompletionResultType]::ParameterValue, 'For more information see `echo test`')
[CompletionResult]::new('cmd-backslash', 'cmd-backslash', [CompletionResultType]::ParameterValue, 'Avoid ''/n''')
[CompletionResult]::new('cmd-backslash', 'cmd-backslash', [CompletionResultType]::ParameterValue, 'Avoid ''\n''')
[CompletionResult]::new('cmd-brackets', 'cmd-brackets', [CompletionResultType]::ParameterValue, 'List packages [filter]')
[CompletionResult]::new('cmd-expansions', 'cmd-expansions', [CompletionResultType]::ParameterValue, 'Execute the shell command with $SHELL')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
@ -74,7 +74,7 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
[CompletionResult]::new('cmd-single-quotes', 'cmd-single-quotes', [CompletionResultType]::ParameterValue, 'Can be ''always'', ''auto'', or ''never''')
[CompletionResult]::new('cmd-double-quotes', 'cmd-double-quotes', [CompletionResultType]::ParameterValue, 'Can be "always", "auto", or "never"')
[CompletionResult]::new('cmd-backticks', 'cmd-backticks', [CompletionResultType]::ParameterValue, 'For more information see `echo test`')
[CompletionResult]::new('cmd-backslash', 'cmd-backslash', [CompletionResultType]::ParameterValue, 'Avoid ''/n''')
[CompletionResult]::new('cmd-backslash', 'cmd-backslash', [CompletionResultType]::ParameterValue, 'Avoid ''\n''')
[CompletionResult]::new('cmd-brackets', 'cmd-brackets', [CompletionResultType]::ParameterValue, 'List packages [filter]')
[CompletionResult]::new('cmd-expansions', 'cmd-expansions', [CompletionResultType]::ParameterValue, 'Execute the shell command with $SHELL')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')

View file

@ -14,19 +14,19 @@ _my-app() {
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" /
'*--single-quotes[Can be '/''always'/'', '/''auto'/'', or '/''never'/'']' /
'*--double-quotes[Can be "always", "auto", or "never"]' /
'*--backticks[For more information see `echo test`]' /
'*--backslash[Avoid '/''//n'/'']' /
'*--brackets[List packages /[filter/]]' /
'*--expansions[Execute the shell command with $SHELL]' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
":: :_my-app_commands" /
"*::: :->my-app" /
_arguments "${_arguments_options[@]}" \
'*--single-quotes[Can be '\''always'\'', '\''auto'\'', or '\''never'\'']' \
'*--double-quotes[Can be "always", "auto", or "never"]' \
'*--backticks[For more information see `echo test`]' \
'*--backslash[Avoid '\''\\n'\'']' \
'*--brackets[List packages \[filter\]]' \
'*--expansions[Execute the shell command with $SHELL]' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
":: :_my-app_commands" \
"*::: :->my-app" \
&& ret=0
case $state in
(my-app)
@ -35,45 +35,45 @@ _my-app() {
curcontext="${curcontext%:*:*}:my-app-command-$line[1]:"
case $line[1] in
(cmd-single-quotes)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
&& ret=0
;;
(cmd-double-quotes)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
&& ret=0
;;
(cmd-backticks)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
&& ret=0
;;
(cmd-backslash)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
&& ret=0
;;
(cmd-brackets)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
&& ret=0
;;
(cmd-expansions)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
":: :_my-app__help_commands" /
"*::: :->help" /
_arguments "${_arguments_options[@]}" \
":: :_my-app__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
@ -83,31 +83,31 @@ _arguments "${_arguments_options[@]}" /
curcontext="${curcontext%:*:*}:my-app-help-command-$line[1]:"
case $line[1] in
(cmd-single-quotes)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(cmd-double-quotes)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(cmd-backticks)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(cmd-backslash)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(cmd-brackets)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(cmd-expansions)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
@ -122,13 +122,13 @@ esac
(( $+functions[_my-app_commands] )) ||
_my-app_commands() {
local commands; commands=(
'cmd-single-quotes:Can be '/''always'/'', '/''auto'/'', or '/''never'/''' /
'cmd-double-quotes:Can be "always", "auto", or "never"' /
'cmd-backticks:For more information see `echo test`' /
'cmd-backslash:Avoid '/''//n'/''' /
'cmd-brackets:List packages /[filter/]' /
'cmd-expansions:Execute the shell command with $SHELL' /
'help:Print this message or the help of the given subcommand(s)' /
'cmd-single-quotes:Can be '\''always'\'', '\''auto'\'', or '\''never'\''' \
'cmd-double-quotes:Can be "always", "auto", or "never"' \
'cmd-backticks:For more information see `echo test`' \
'cmd-backslash:Avoid '\''\\n'\''' \
'cmd-brackets:List packages \[filter\]' \
'cmd-expansions:Execute the shell command with $SHELL' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app commands' commands "$@"
}
@ -195,13 +195,13 @@ _my-app__help__cmd-single-quotes_commands() {
(( $+functions[_my-app__help_commands] )) ||
_my-app__help_commands() {
local commands; commands=(
'cmd-single-quotes:Can be '/''always'/'', '/''auto'/'', or '/''never'/''' /
'cmd-double-quotes:Can be "always", "auto", or "never"' /
'cmd-backticks:For more information see `echo test`' /
'cmd-backslash:Avoid '/''//n'/''' /
'cmd-brackets:List packages /[filter/]' /
'cmd-expansions:Execute the shell command with $SHELL' /
'help:Print this message or the help of the given subcommand(s)' /
'cmd-single-quotes:Can be '\''always'\'', '\''auto'\'', or '\''never'\''' \
'cmd-double-quotes:Can be "always", "auto", or "never"' \
'cmd-backticks:For more information see `echo test`' \
'cmd-backslash:Avoid '\''\\n'\''' \
'cmd-brackets:List packages \[filter\]' \
'cmd-expansions:Execute the shell command with $SHELL' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app help commands' commands "$@"
}

View file

@ -14,19 +14,19 @@ _my-app() {
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" /
'*-c[some config file]' /
'*-C[some config file]' /
'*--config[some config file]' /
'*--conf[some config file]' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
'::file -- some input file:_files' /
'::choice:(first second)' /
":: :_my-app_commands" /
"*::: :->my-app" /
_arguments "${_arguments_options[@]}" \
'*-c[some config file]' \
'*-C[some config file]' \
'*--config[some config file]' \
'*--conf[some config file]' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
'::file -- some input file:_files' \
'::choice:(first second)' \
":: :_my-app_commands" \
"*::: :->my-app" \
&& ret=0
case $state in
(my-app)
@ -35,44 +35,44 @@ _my-app() {
curcontext="${curcontext%:*:*}:my-app-command-$line[3]:"
case $line[3] in
(test)
_arguments "${_arguments_options[@]}" /
'*--case=[the case to test]: : ' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
_arguments "${_arguments_options[@]}" \
'*--case=[the case to test]: : ' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
&& ret=0
;;
(some_cmd)
_arguments "${_arguments_options[@]}" /
'*--config=[the other case to test]: : ' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
'*::path:' /
_arguments "${_arguments_options[@]}" \
'*--config=[the other case to test]: : ' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
'*::path:' \
&& ret=0
;;
(some-cmd-with-hyphens)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
&& ret=0
;;
(some-hidden-cmd)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
":: :_my-app__help_commands" /
"*::: :->help" /
_arguments "${_arguments_options[@]}" \
":: :_my-app__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
@ -82,23 +82,23 @@ _arguments "${_arguments_options[@]}" /
curcontext="${curcontext%:*:*}:my-app-help-command-$line[1]:"
case $line[1] in
(test)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(some_cmd)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(some-cmd-with-hyphens)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(some-hidden-cmd)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
@ -113,22 +113,22 @@ esac
(( $+functions[_my-app_commands] )) ||
_my-app_commands() {
local commands; commands=(
'test:tests things' /
'some_cmd:tests other things' /
'some-cmd-with-hyphens:' /
'some-hidden-cmd:' /
'help:Print this message or the help of the given subcommand(s)' /
'test:tests things' \
'some_cmd:tests other things' \
'some-cmd-with-hyphens:' \
'some-hidden-cmd:' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app commands' commands "$@"
}
(( $+functions[_my-app__help_commands] )) ||
_my-app__help_commands() {
local commands; commands=(
'test:tests things' /
'some_cmd:tests other things' /
'some-cmd-with-hyphens:' /
'some-hidden-cmd:' /
'help:Print this message or the help of the given subcommand(s)' /
'test:tests things' \
'some_cmd:tests other things' \
'some-cmd-with-hyphens:' \
'some-hidden-cmd:' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app help commands' commands "$@"
}

View file

@ -11,7 +11,7 @@ complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and not __fish_seen
complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from sub_cmd; and not __fish_seen_subcommand_from help" -s V -l version -d 'Print version information'
complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from sub_cmd; and not __fish_seen_subcommand_from help" -f -a "sub_cmd" -d 'sub-subcommand'
complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from sub_cmd; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from sub_cmd" -l config -d 'the other case to test' -r -f -a "{Lest quotes aren/'t escaped. }"
complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from sub_cmd" -l config -d 'the other case to test' -r -f -a "{Lest quotes aren\'t escaped. }"
complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from sub_cmd" -s h -l help -d 'Print help information'
complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from sub_cmd" -s V -l version -d 'Print version information'
complete -c my-app -n "__fish_seen_subcommand_from some_cmd; and __fish_seen_subcommand_from help; and not __fish_seen_subcommand_from sub_cmd; and not __fish_seen_subcommand_from help" -f -a "sub_cmd" -d 'sub-subcommand'

View file

@ -14,19 +14,19 @@ _my-app() {
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" /
'*-c[some config file]' /
'*-C[some config file]' /
'*--config[some config file]' /
'*--conf[some config file]' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
'::file -- some input file:_files' /
'::choice:(first second)' /
":: :_my-app_commands" /
"*::: :->my-app" /
_arguments "${_arguments_options[@]}" \
'*-c[some config file]' \
'*-C[some config file]' \
'*--config[some config file]' \
'*--conf[some config file]' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
'::file -- some input file:_files' \
'::choice:(first second)' \
":: :_my-app_commands" \
"*::: :->my-app" \
&& ret=0
case $state in
(my-app)
@ -35,22 +35,22 @@ _my-app() {
curcontext="${curcontext%:*:*}:my-app-command-$line[3]:"
case $line[3] in
(test)
_arguments "${_arguments_options[@]}" /
'*--case=[the case to test]: : ' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
_arguments "${_arguments_options[@]}" \
'*--case=[the case to test]: : ' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
&& ret=0
;;
(some_cmd)
_arguments "${_arguments_options[@]}" /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
":: :_my-app__some_cmd_commands" /
"*::: :->some_cmd" /
_arguments "${_arguments_options[@]}" \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
":: :_my-app__some_cmd_commands" \
"*::: :->some_cmd" \
&& ret=0
case $state in
@ -60,18 +60,18 @@ _arguments "${_arguments_options[@]}" /
curcontext="${curcontext%:*:*}:my-app-some_cmd-command-$line[1]:"
case $line[1] in
(sub_cmd)
_arguments "${_arguments_options[@]}" /
'*--config=[the other case to test]: :(Lest quotes aren't escaped.)' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*-V[Print version information]' /
'*--version[Print version information]' /
_arguments "${_arguments_options[@]}" \
'*--config=[the other case to test]: :(Lest quotes aren't escaped.)' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*-V[Print version information]' \
'*--version[Print version information]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
":: :_my-app__some_cmd__help_commands" /
"*::: :->help" /
_arguments "${_arguments_options[@]}" \
":: :_my-app__some_cmd__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
@ -81,11 +81,11 @@ _arguments "${_arguments_options[@]}" /
curcontext="${curcontext%:*:*}:my-app-some_cmd-help-command-$line[1]:"
case $line[1] in
(sub_cmd)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
@ -97,9 +97,9 @@ esac
esac
;;
(help)
_arguments "${_arguments_options[@]}" /
":: :_my-app__help_commands" /
"*::: :->help" /
_arguments "${_arguments_options[@]}" \
":: :_my-app__help_commands" \
"*::: :->help" \
&& ret=0
case $state in
@ -109,13 +109,13 @@ _arguments "${_arguments_options[@]}" /
curcontext="${curcontext%:*:*}:my-app-help-command-$line[1]:"
case $line[1] in
(test)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
(some_cmd)
_arguments "${_arguments_options[@]}" /
":: :_my-app__help__some_cmd_commands" /
"*::: :->some_cmd" /
_arguments "${_arguments_options[@]}" \
":: :_my-app__help__some_cmd_commands" \
"*::: :->some_cmd" \
&& ret=0
case $state in
@ -125,7 +125,7 @@ _arguments "${_arguments_options[@]}" /
curcontext="${curcontext%:*:*}:my-app-help-some_cmd-command-$line[1]:"
case $line[1] in
(sub_cmd)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
@ -133,7 +133,7 @@ _arguments "${_arguments_options[@]}" /
esac
;;
(help)
_arguments "${_arguments_options[@]}" /
_arguments "${_arguments_options[@]}" \
&& ret=0
;;
esac
@ -148,18 +148,18 @@ esac
(( $+functions[_my-app_commands] )) ||
_my-app_commands() {
local commands; commands=(
'test:tests things' /
'some_cmd:top level subcommand' /
'help:Print this message or the help of the given subcommand(s)' /
'test:tests things' \
'some_cmd:top level subcommand' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app commands' commands "$@"
}
(( $+functions[_my-app__help_commands] )) ||
_my-app__help_commands() {
local commands; commands=(
'test:tests things' /
'some_cmd:top level subcommand' /
'help:Print this message or the help of the given subcommand(s)' /
'test:tests things' \
'some_cmd:top level subcommand' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app help commands' commands "$@"
}
@ -171,8 +171,8 @@ _my-app__help__help_commands() {
(( $+functions[_my-app__some_cmd__help_commands] )) ||
_my-app__some_cmd__help_commands() {
local commands; commands=(
'sub_cmd:sub-subcommand' /
'help:Print this message or the help of the given subcommand(s)' /
'sub_cmd:sub-subcommand' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app some_cmd help commands' commands "$@"
}
@ -184,15 +184,15 @@ _my-app__some_cmd__help__help_commands() {
(( $+functions[_my-app__help__some_cmd_commands] )) ||
_my-app__help__some_cmd_commands() {
local commands; commands=(
'sub_cmd:sub-subcommand' /
'sub_cmd:sub-subcommand' \
)
_describe -t commands 'my-app help some_cmd commands' commands "$@"
}
(( $+functions[_my-app__some_cmd_commands] )) ||
_my-app__some_cmd_commands() {
local commands; commands=(
'sub_cmd:sub-subcommand' /
'help:Print this message or the help of the given subcommand(s)' /
'sub_cmd:sub-subcommand' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'my-app some_cmd commands' commands "$@"
}

View file

@ -14,30 +14,30 @@ _my-app() {
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" /
'*--choice=[]: :(bash fish zsh)' /
'*--unknown=[]: : ' /
'*--other=[]: :( )' /
'*-p+[]: :_files' /
'*--path=[]: :_files' /
'*-f+[]: :_files' /
'*--file=[]: :_files' /
'*-d+[]: :_files -/' /
'*--dir=[]: :_files -/' /
'*-e+[]: :_absolute_command_paths' /
'*--exe=[]: :_absolute_command_paths' /
'*--cmd-name=[]: :_command_names -e' /
'*-c+[]: :_cmdstring' /
'*--cmd=[]: :_cmdstring' /
'*-u+[]: :_users' /
'*--user=[]: :_users' /
'*-H+[]: :_hosts' /
'*--host=[]: :_hosts' /
'*--url=[]: :_urls' /
'*--email=[]: :_email_addresses' /
'*-h[Print help information]' /
'*--help[Print help information]' /
'*::command_with_args:_cmdambivalent' /
_arguments "${_arguments_options[@]}" \
'*--choice=[]: :(bash fish zsh)' \
'*--unknown=[]: : ' \
'*--other=[]: :( )' \
'*-p+[]: :_files' \
'*--path=[]: :_files' \
'*-f+[]: :_files' \
'*--file=[]: :_files' \
'*-d+[]: :_files -/' \
'*--dir=[]: :_files -/' \
'*-e+[]: :_absolute_command_paths' \
'*--exe=[]: :_absolute_command_paths' \
'*--cmd-name=[]: :_command_names -e' \
'*-c+[]: :_cmdstring' \
'*--cmd=[]: :_cmdstring' \
'*-u+[]: :_users' \
'*--user=[]: :_users' \
'*-H+[]: :_hosts' \
'*--host=[]: :_hosts' \
'*--url=[]: :_urls' \
'*--email=[]: :_email_addresses' \
'*-h[Print help information]' \
'*--help[Print help information]' \
'*::command_with_args:_cmdambivalent' \
&& ret=0
}