mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
fix(help): Remove extraneous text from built-ins
This is an intermediate solution for #4408. As there were no agreeed upon goals, I went with what I felt read well and that I saw commonly used on non-clap commands. - "information" isn't really a necessary word. - I originally favored `Print this help` but realied that doesn't read correctly in completions. - Besides being shorter, the reason for the flipped short/long hint is it gives people the context they need for scanning, emphasizing "summary" and "more". Fixes #4409
This commit is contained in:
parent
e7033f775f
commit
36bc641648
117 changed files with 660 additions and 665 deletions
|
@ -26,10 +26,10 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
cand -F 'cmd flag'
|
||||
cand --flag 'cmd flag'
|
||||
cand --flg 'cmd flag'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
}
|
||||
]
|
||||
$completions[$command]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
complete -c my-app -s o -s O -l option -l opt -d 'cmd option' -r
|
||||
complete -c my-app -s f -s F -l flag -l flg -d 'cmd flag'
|
||||
complete -c my-app -s h -l help -d 'Print help information'
|
||||
complete -c my-app -s V -l version -d 'Print version information'
|
||||
complete -c my-app -s h -l help -d 'Print help'
|
||||
complete -c my-app -s V -l version -d 'Print version'
|
||||
|
|
|
@ -29,10 +29,10 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
[CompletionResult]::new('-F', 'F', [CompletionResultType]::ParameterName, 'cmd flag')
|
||||
[CompletionResult]::new('--flag', 'flag', [CompletionResultType]::ParameterName, 'cmd flag')
|
||||
[CompletionResult]::new('--flg', 'flg', [CompletionResultType]::ParameterName, 'cmd flag')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
break
|
||||
}
|
||||
})
|
||||
|
|
|
@ -23,10 +23,10 @@ _my-app() {
|
|||
'-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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
'::positional:' \
|
||||
&& ret=0
|
||||
}
|
||||
|
|
|
@ -20,16 +20,16 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
&'my-app'= {
|
||||
cand -c 'c'
|
||||
cand -v 'v'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand test 'Subcommand'
|
||||
cand help 'Print this message or the help of the given subcommand(s)'
|
||||
}
|
||||
&'my-app;test'= {
|
||||
cand -d 'd'
|
||||
cand -c 'c'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
}
|
||||
&'my-app;help'= {
|
||||
cand test 'Subcommand'
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
complete -c my-app -n "__fish_use_subcommand" -s c
|
||||
complete -c my-app -n "__fish_use_subcommand" -s v
|
||||
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 h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "test" -d 'Subcommand'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s d
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s c
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "test" -d 'Subcommand'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
||||
|
|
|
@ -23,8 +23,8 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
'my-app' {
|
||||
[CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'c')
|
||||
[CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'v')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'Subcommand')
|
||||
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
|
||||
break
|
||||
|
@ -32,8 +32,8 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
'my-app;test' {
|
||||
[CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'd')
|
||||
[CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'c')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
break
|
||||
}
|
||||
'my-app;help' {
|
||||
|
|
|
@ -17,8 +17,8 @@ _my-app() {
|
|||
_arguments "${_arguments_options[@]}" \
|
||||
'-c[]' \
|
||||
'(-c)-v[]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
":: :_my-app_commands" \
|
||||
"*::: :->my-app" \
|
||||
&& ret=0
|
||||
|
@ -32,8 +32,8 @@ _my-app() {
|
|||
_arguments "${_arguments_options[@]}" \
|
||||
'*-d[]' \
|
||||
'-c[]' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
|
|
|
@ -22,19 +22,19 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
cand -C 'some config file'
|
||||
cand --config 'some config file'
|
||||
cand --conf 'some config file'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
cand test 'tests things'
|
||||
cand help 'Print this message or the help of the given subcommand(s)'
|
||||
}
|
||||
&'my-app;test'= {
|
||||
cand --case 'the case to test'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
}
|
||||
&'my-app;help'= {
|
||||
cand test 'tests things'
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
complete -c my-app -n "__fish_use_subcommand" -s c -s C -l config -l conf -d 'some config file'
|
||||
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" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_use_subcommand" -s V -l version -d 'Print version'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "test" -d 'tests things'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -l case -d 'the case to test' -r
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s V -l version -d 'Print version information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s V -l version -d 'Print version'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "test" -d 'tests things'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
||||
|
|
|
@ -25,20 +25,20 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
[CompletionResult]::new('-C', 'C', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('--conf', 'conf', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'tests things')
|
||||
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
|
||||
break
|
||||
}
|
||||
'my-app;test' {
|
||||
[CompletionResult]::new('--case', 'case', [CompletionResultType]::ParameterName, 'the case to test')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
break
|
||||
}
|
||||
'my-app;help' {
|
||||
|
|
|
@ -19,10 +19,10 @@ _my-app() {
|
|||
'*-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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
'::file -- some input file:_files' \
|
||||
'::choice:(first second)' \
|
||||
":: :_my-app_commands" \
|
||||
|
@ -37,10 +37,10 @@ _my-app() {
|
|||
(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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
|
|
|
@ -24,10 +24,10 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
cand --backslash 'Avoid ''\n'''
|
||||
cand --brackets 'List packages [filter]'
|
||||
cand --expansions 'Execute the shell command with $SHELL'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
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`'
|
||||
|
@ -37,28 +37,28 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
cand help 'Print this message or the help of the given subcommand(s)'
|
||||
}
|
||||
&'my-app;cmd-single-quotes'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
}
|
||||
&'my-app;cmd-double-quotes'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
}
|
||||
&'my-app;cmd-backticks'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
}
|
||||
&'my-app;cmd-backslash'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
}
|
||||
&'my-app;cmd-brackets'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
}
|
||||
&'my-app;cmd-expansions'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
}
|
||||
&'my-app;help'= {
|
||||
cand cmd-single-quotes 'Can be ''always'', ''auto'', or ''never'''
|
||||
|
|
|
@ -4,8 +4,8 @@ complete -c my-app -n "__fish_use_subcommand" -l backticks -d 'For more informat
|
|||
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" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_use_subcommand" -s V -l version -d 'Print version'
|
||||
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`'
|
||||
|
@ -13,12 +13,12 @@ complete -c my-app -n "__fish_use_subcommand" -f -a "cmd-backslash" -d 'Avoid \'
|
|||
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)'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from cmd-single-quotes" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from cmd-double-quotes" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from cmd-backticks" -s h -l help -d 'Print help information'
|
||||
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 cmd-single-quotes" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from cmd-double-quotes" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from cmd-backticks" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from cmd-backslash" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from cmd-brackets" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from cmd-expansions" -s h -l help -d 'Print help'
|
||||
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`'
|
||||
|
|
|
@ -27,10 +27,10 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
[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')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[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`')
|
||||
|
@ -41,33 +41,33 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
break
|
||||
}
|
||||
'my-app;cmd-single-quotes' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
break
|
||||
}
|
||||
'my-app;cmd-double-quotes' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
break
|
||||
}
|
||||
'my-app;cmd-backticks' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
break
|
||||
}
|
||||
'my-app;cmd-backslash' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
break
|
||||
}
|
||||
'my-app;cmd-brackets' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
break
|
||||
}
|
||||
'my-app;cmd-expansions' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
break
|
||||
}
|
||||
'my-app;help' {
|
||||
|
|
|
@ -21,10 +21,10 @@ _my-app() {
|
|||
'--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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
":: :_my-app_commands" \
|
||||
"*::: :->my-app" \
|
||||
&& ret=0
|
||||
|
@ -36,38 +36,38 @@ _my-app() {
|
|||
case $line[1] in
|
||||
(cmd-single-quotes)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(cmd-double-quotes)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(cmd-backticks)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(cmd-backslash)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(cmd-brackets)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(cmd-expansions)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
|
|
|
@ -22,10 +22,10 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
cand -C 'some config file'
|
||||
cand --config 'some config file'
|
||||
cand --conf 'some config file'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
cand test 'tests things'
|
||||
cand some_cmd 'tests other things'
|
||||
cand some-cmd-with-hyphens 'some-cmd-with-hyphens'
|
||||
|
@ -34,29 +34,29 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
}
|
||||
&'my-app;test'= {
|
||||
cand --case 'the case to test'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
}
|
||||
&'my-app;some_cmd'= {
|
||||
cand --config 'the other case to test'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
}
|
||||
&'my-app;some-cmd-with-hyphens'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
}
|
||||
&'my-app;some-hidden-cmd'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
}
|
||||
&'my-app;help'= {
|
||||
cand test 'tests things'
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
complete -c my-app -n "__fish_use_subcommand" -s c -s C -l config -l conf -d 'some config file'
|
||||
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" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_use_subcommand" -s V -l version -d 'Print version'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "test" -d 'tests things'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "some_cmd" -d 'tests other things'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "some-cmd-with-hyphens"
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "some-hidden-cmd"
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -l case -d 'the case to test' -r
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s V -l version -d 'Print version information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s V -l version -d 'Print version'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some_cmd" -l config -d 'the other case to test' -r
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some_cmd" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some_cmd" -s V -l version -d 'Print version information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some-cmd-with-hyphens" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some-cmd-with-hyphens" -s V -l version -d 'Print version information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some-hidden-cmd" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some-hidden-cmd" -s V -l version -d 'Print version information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some_cmd" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some_cmd" -s V -l version -d 'Print version'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some-cmd-with-hyphens" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some-cmd-with-hyphens" -s V -l version -d 'Print version'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some-hidden-cmd" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from some-hidden-cmd" -s V -l version -d 'Print version'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from some-cmd-with-hyphens; and not __fish_seen_subcommand_from some-hidden-cmd; and not __fish_seen_subcommand_from help" -f -a "test" -d 'tests things'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from some-cmd-with-hyphens; and not __fish_seen_subcommand_from some-hidden-cmd; and not __fish_seen_subcommand_from help" -f -a "some_cmd" -d 'tests other things'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from some-cmd-with-hyphens; and not __fish_seen_subcommand_from some-hidden-cmd; and not __fish_seen_subcommand_from help" -f -a "some-cmd-with-hyphens"
|
||||
|
|
|
@ -25,10 +25,10 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
[CompletionResult]::new('-C', 'C', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('--conf', 'conf', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'tests things')
|
||||
[CompletionResult]::new('some_cmd', 'some_cmd', [CompletionResultType]::ParameterValue, 'tests other things')
|
||||
[CompletionResult]::new('some-cmd-with-hyphens', 'some-cmd-with-hyphens', [CompletionResultType]::ParameterValue, 'some-cmd-with-hyphens')
|
||||
|
@ -38,32 +38,32 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
}
|
||||
'my-app;test' {
|
||||
[CompletionResult]::new('--case', 'case', [CompletionResultType]::ParameterName, 'the case to test')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
break
|
||||
}
|
||||
'my-app;some_cmd' {
|
||||
[CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'the other case to test')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
break
|
||||
}
|
||||
'my-app;some-cmd-with-hyphens' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
break
|
||||
}
|
||||
'my-app;some-hidden-cmd' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
break
|
||||
}
|
||||
'my-app;help' {
|
||||
|
|
|
@ -19,10 +19,10 @@ _my-app() {
|
|||
'*-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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
'::file -- some input file:_files' \
|
||||
'::choice:(first second)' \
|
||||
":: :_my-app_commands" \
|
||||
|
@ -37,36 +37,36 @@ _my-app() {
|
|||
(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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
&& 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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
'*::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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(some-hidden-cmd)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
|
|
|
@ -22,35 +22,35 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
cand -C 'some config file'
|
||||
cand --config 'some config file'
|
||||
cand --conf 'some config file'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
cand test 'tests things'
|
||||
cand some_cmd 'top level subcommand'
|
||||
cand help 'Print this message or the help of the given subcommand(s)'
|
||||
}
|
||||
&'my-app;test'= {
|
||||
cand --case 'the case to test'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
}
|
||||
&'my-app;some_cmd'= {
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
cand sub_cmd 'sub-subcommand'
|
||||
cand help 'Print this message or the help of the given subcommand(s)'
|
||||
}
|
||||
&'my-app;some_cmd;sub_cmd'= {
|
||||
cand --config 'the other case to test'
|
||||
cand -h 'Print help information (use `--help` for more detail)'
|
||||
cand --help 'Print help information (use `--help` for more detail)'
|
||||
cand -V 'Print version information'
|
||||
cand --version 'Print version information'
|
||||
cand -h 'Print help (see more with ''--help'')'
|
||||
cand --help 'Print help (see more with ''--help'')'
|
||||
cand -V 'Print version'
|
||||
cand --version 'Print version'
|
||||
}
|
||||
&'my-app;some_cmd;help'= {
|
||||
cand sub_cmd 'sub-subcommand'
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
complete -c my-app -n "__fish_use_subcommand" -s c -s C -l config -l conf -d 'some config file'
|
||||
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" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_use_subcommand" -s V -l version -d 'Print version'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "test" -d 'tests things'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "some_cmd" -d 'top level subcommand'
|
||||
complete -c my-app -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -l case -d 'the case to test' -r
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -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" -s h -l help -d 'Print help 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" -s V -l version -d 'Print version information'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from test" -s V -l version -d 'Print version'
|
||||
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 h -l help -d 'Print help'
|
||||
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'
|
||||
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. help\,with\,comma,Second to trigger display of options }"
|
||||
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 (use `--help` for more detail)'
|
||||
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 sub_cmd" -s h -l help -d 'Print help (see more with \'--help\')'
|
||||
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'
|
||||
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'
|
||||
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 "help" -d 'Print this message or the help of the given subcommand(s)'
|
||||
complete -c my-app -n "__fish_seen_subcommand_from help; and not __fish_seen_subcommand_from test; and not __fish_seen_subcommand_from some_cmd; and not __fish_seen_subcommand_from help" -f -a "test" -d 'tests things'
|
||||
|
|
|
@ -25,10 +25,10 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
[CompletionResult]::new('-C', 'C', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('--conf', 'conf', [CompletionResultType]::ParameterName, 'some config file')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'tests things')
|
||||
[CompletionResult]::new('some_cmd', 'some_cmd', [CompletionResultType]::ParameterValue, 'top level subcommand')
|
||||
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
|
||||
|
@ -36,27 +36,27 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
}
|
||||
'my-app;test' {
|
||||
[CompletionResult]::new('--case', 'case', [CompletionResultType]::ParameterName, 'the case to test')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
break
|
||||
}
|
||||
'my-app;some_cmd' {
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('sub_cmd', 'sub_cmd', [CompletionResultType]::ParameterValue, 'sub-subcommand')
|
||||
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
|
||||
break
|
||||
}
|
||||
'my-app;some_cmd;sub_cmd' {
|
||||
[CompletionResult]::new('--config', 'config', [CompletionResultType]::ParameterName, 'the other case to test')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information (use `--help` for more detail)')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information (use `--help` for more detail)')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
|
||||
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version')
|
||||
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version')
|
||||
break
|
||||
}
|
||||
'my-app;some_cmd;help' {
|
||||
|
|
|
@ -19,10 +19,10 @@ _my-app() {
|
|||
'*-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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
'::file -- some input file:_files' \
|
||||
'::choice:(first second)' \
|
||||
":: :_my-app_commands" \
|
||||
|
@ -37,18 +37,18 @@ _my-app() {
|
|||
(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]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(some_cmd)
|
||||
_arguments "${_arguments_options[@]}" \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
":: :_my-app__some_cmd_commands" \
|
||||
"*::: :->some_cmd" \
|
||||
&& ret=0
|
||||
|
@ -63,10 +63,10 @@ _arguments "${_arguments_options[@]}" \
|
|||
_arguments "${_arguments_options[@]}" \
|
||||
'--config=[the other case to test]: :((Lest\ quotes,\ aren'\''t\ escaped.\:"help,with,comma"
|
||||
Second\ to\ trigger\ display\ of\ options\:""))' \
|
||||
'-h[Print help information (use `--help` for more detail)]' \
|
||||
'--help[Print help information (use `--help` for more detail)]' \
|
||||
'-V[Print version information]' \
|
||||
'--version[Print version information]' \
|
||||
'-h[Print help (see more with '\''--help'\'')]' \
|
||||
'--help[Print help (see more with '\''--help'\'')]' \
|
||||
'-V[Print version]' \
|
||||
'--version[Print version]' \
|
||||
&& ret=0
|
||||
;;
|
||||
(help)
|
||||
|
|
|
@ -38,8 +38,8 @@ set edit:completion:arg-completer[my-app] = {|@words|
|
|||
cand --host 'host'
|
||||
cand --url 'url'
|
||||
cand --email 'email'
|
||||
cand -h 'Print help information'
|
||||
cand --help 'Print help information'
|
||||
cand -h 'Print help'
|
||||
cand --help 'Print help'
|
||||
}
|
||||
]
|
||||
$completions[$command]
|
||||
|
|
|
@ -11,4 +11,4 @@ complete -c my-app -s u -l user -r -f -a "(__fish_complete_users)"
|
|||
complete -c my-app -s H -l host -r -f -a "(__fish_print_hostnames)"
|
||||
complete -c my-app -l url -r -f
|
||||
complete -c my-app -l email -r -f
|
||||
complete -c my-app -s h -l help -d 'Print help information'
|
||||
complete -c my-app -s h -l help -d 'Print help'
|
||||
|
|
|
@ -41,8 +41,8 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock {
|
|||
[CompletionResult]::new('--host', 'host', [CompletionResultType]::ParameterName, 'host')
|
||||
[CompletionResult]::new('--url', 'url', [CompletionResultType]::ParameterName, 'url')
|
||||
[CompletionResult]::new('--email', 'email', [CompletionResultType]::ParameterName, 'email')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help information')
|
||||
[CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help')
|
||||
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help')
|
||||
break
|
||||
}
|
||||
})
|
||||
|
|
|
@ -35,8 +35,8 @@ _my-app() {
|
|||
'--host=[]: :_hosts' \
|
||||
'--url=[]: :_urls' \
|
||||
'--email=[]: :_email_addresses' \
|
||||
'-h[Print help information]' \
|
||||
'--help[Print help information]' \
|
||||
'-h[Print help]' \
|
||||
'--help[Print help]' \
|
||||
'*::command_with_args:_cmdambivalent' \
|
||||
&& ret=0
|
||||
}
|
||||
|
|
|
@ -17,11 +17,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
|
|
|
@ -15,7 +15,7 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -46,7 +46,7 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -17,11 +17,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -48,11 +48,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
args: [
|
||||
|
|
|
@ -8,7 +8,7 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -18,7 +18,7 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -28,7 +28,7 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -38,7 +38,7 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -48,7 +48,7 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -58,7 +58,7 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -124,11 +124,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -17,11 +17,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -42,11 +42,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
|
@ -60,11 +60,11 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -74,11 +74,11 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -116,11 +116,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
args: [
|
||||
|
|
|
@ -17,11 +17,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -47,11 +47,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -73,11 +73,11 @@ const completion: Fig.Spec = {
|
|||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -114,11 +114,11 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version information",
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
args: [
|
||||
|
|
|
@ -119,7 +119,7 @@ const completion: Fig.Spec = {
|
|||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help information",
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
|
|
|
@ -16,10 +16,10 @@ cmd flag
|
|||
cmd option
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information
|
||||
Print help
|
||||
.TP
|
||||
/fB/-V/fR, /fB/-/-version/fR
|
||||
Print version information
|
||||
Print version
|
||||
.TP
|
||||
[/fIpositional/fR]
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ my/-app
|
|||
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information
|
||||
Print help
|
||||
.SH SUBCOMMANDS
|
||||
.TP
|
||||
my/-app/-test(1)
|
||||
|
|
|
@ -13,10 +13,10 @@ Tests completions
|
|||
some config file
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information
|
||||
Print help
|
||||
.TP
|
||||
/fB/-V/fR, /fB/-/-version/fR
|
||||
Print version information
|
||||
Print version
|
||||
.TP
|
||||
[/fIfile/fR]
|
||||
some input file
|
||||
|
|
|
@ -12,4 +12,4 @@ my/-app
|
|||
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information
|
||||
Print help
|
||||
|
|
|
@ -25,7 +25,7 @@ slow: use the slow method
|
|||
.RE
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information (use `/-h` for a summary)
|
||||
Print help (see a summary with /*(Aq/-h/*(Aq)
|
||||
.TP
|
||||
[/fIpositional_choice/fR]
|
||||
Pick the Position you want the command to run in
|
||||
|
|
|
@ -27,10 +27,10 @@ List packages [filter]
|
|||
Execute the shell command with $SHELL
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information
|
||||
Print help
|
||||
.TP
|
||||
/fB/-V/fR, /fB/-/-version/fR
|
||||
Print version information
|
||||
Print version
|
||||
.SH SUBCOMMANDS
|
||||
.TP
|
||||
my/-app/-cmd/-single/-quotes(1)
|
||||
|
|
|
@ -13,10 +13,10 @@ Tests completions
|
|||
some config file
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information
|
||||
Print help
|
||||
.TP
|
||||
/fB/-V/fR, /fB/-/-version/fR
|
||||
Print version information
|
||||
Print version
|
||||
.TP
|
||||
[/fIfile/fR]
|
||||
some input file
|
||||
|
|
|
@ -13,10 +13,10 @@ Tests completions
|
|||
some config file
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information
|
||||
Print help
|
||||
.TP
|
||||
/fB/-V/fR, /fB/-/-version/fR
|
||||
Print version information
|
||||
Print version
|
||||
.TP
|
||||
[/fIfile/fR]
|
||||
some input file
|
||||
|
|
|
@ -15,4 +15,4 @@ May also be specified with the /fBCONFIG_FILE/fR environment variable.
|
|||
.RE
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information (use `/-h` for a summary)
|
||||
Print help (see a summary with /*(Aq/-h/*(Aq)
|
||||
|
|
|
@ -50,7 +50,7 @@ my/-app
|
|||
|
||||
.TP
|
||||
/fB/-h/fR, /fB/-/-help/fR
|
||||
Print help information
|
||||
Print help
|
||||
.TP
|
||||
[/fIcommand_with_args/fR]
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ cargo-example-derive example-derive --help
|
||||
A simple to use, efficient, and full-featured Command Line Argument Parser
|
||||
|
@ -22,8 +22,8 @@ Usage: cargo example-derive [OPTIONS]
|
|||
|
||||
Options:
|
||||
--manifest-path <MANIFEST_PATH>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ cargo-example example --help
|
||||
A simple to use, efficient, and full-featured Command Line Argument Parser
|
||||
|
@ -22,8 +22,8 @@ Usage: cargo example [OPTIONS]
|
|||
|
||||
Options:
|
||||
--manifest-path <PATH>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ Usage: demo[EXE] [OPTIONS] --name <NAME>
|
|||
Options:
|
||||
-n, --name <NAME> Name of the person to greet
|
||||
-c, --count <COUNT> Number of times to greet [default: 1]
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ demo --name Me
|
||||
Hello Me!
|
||||
|
|
|
@ -103,7 +103,7 @@ Commands:
|
|||
|
||||
Options:
|
||||
-t, --top-level
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ Arguments:
|
|||
Options:
|
||||
-f
|
||||
-p <PEAR>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ Arguments:
|
|||
Options:
|
||||
-f
|
||||
-p <PEAR>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ A simple to use, efficient, and full-featured Command Line Argument Parser
|
|||
Usage: find[EXE] [OPTIONS]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
TESTS:
|
||||
--empty File is empty and is either a regular file or a directory
|
||||
|
|
|
@ -19,7 +19,7 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git-derive help
|
||||
A fictional versioning CLI
|
||||
|
@ -35,7 +35,7 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git-derive help add
|
||||
adds things
|
||||
|
@ -46,7 +46,7 @@ Arguments:
|
|||
<PATH>... Stuff to add
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
```
|
||||
|
||||
|
@ -62,7 +62,7 @@ Arguments:
|
|||
<PATH>... Stuff to add
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git-derive add Cargo.toml Cargo.lock
|
||||
Adding ["Cargo.toml", "Cargo.lock"]
|
||||
|
@ -83,14 +83,14 @@ Commands:
|
|||
|
||||
Options:
|
||||
-m, --message <MESSAGE>
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git-derive stash push -h
|
||||
Usage: git-derive[EXE] stash push [OPTIONS]
|
||||
|
||||
Options:
|
||||
-m, --message <MESSAGE>
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git-derive stash pop -h
|
||||
Usage: git-derive[EXE] stash pop [STASH]
|
||||
|
@ -99,7 +99,7 @@ Arguments:
|
|||
[STASH]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git-derive stash -m "Prototype"
|
||||
Pushing StashPush { message: Some("Prototype") }
|
||||
|
@ -136,7 +136,7 @@ Arguments:
|
|||
|
||||
Options:
|
||||
--color[=<WHEN>] [default: auto] [possible values: always, auto, never]
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git-derive diff
|
||||
Diffing stage..worktree (color=auto)
|
||||
|
|
|
@ -17,7 +17,7 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git help
|
||||
A fictional versioning CLI
|
||||
|
@ -33,7 +33,7 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git help add
|
||||
adds things
|
||||
|
@ -44,7 +44,7 @@ Arguments:
|
|||
<PATH>... Stuff to add
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
```
|
||||
|
||||
|
@ -60,7 +60,7 @@ Arguments:
|
|||
<PATH>... Stuff to add
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git add Cargo.toml Cargo.lock
|
||||
Adding ["Cargo.toml", "Cargo.lock"]
|
||||
|
@ -81,14 +81,14 @@ Commands:
|
|||
|
||||
Options:
|
||||
-m, --message <MESSAGE>
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git stash push -h
|
||||
Usage: git[EXE] stash push [OPTIONS]
|
||||
|
||||
Options:
|
||||
-m, --message <MESSAGE>
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git stash pop -h
|
||||
Usage: git[EXE] stash pop [STASH]
|
||||
|
@ -97,7 +97,7 @@ Arguments:
|
|||
[STASH]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git stash -m "Prototype"
|
||||
Pushing Some("Prototype")
|
||||
|
@ -134,7 +134,7 @@ Arguments:
|
|||
|
||||
Options:
|
||||
--color[=<WHEN>] [default: auto] [possible values: always, auto, never]
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
$ git diff
|
||||
Diffing stage..worktree (color=auto)
|
||||
|
|
|
@ -34,6 +34,6 @@ APPLETS:
|
|||
|
||||
Options:
|
||||
--install <install> Install hardlinks for all subcommands in path
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
```
|
||||
|
|
|
@ -45,8 +45,8 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ pacman -S -h
|
||||
Synchronize packages.
|
||||
|
@ -59,7 +59,7 @@ Arguments:
|
|||
Options:
|
||||
-s, --search <search>... search remote repositories for matching strings
|
||||
-i, --info view package information
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ Arguments:
|
|||
Options:
|
||||
-c, --config <FILE> Sets a custom config file
|
||||
-d, --debug... Turn debugging information on
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ Options:
|
|||
--one <VALUE>
|
||||
|
||||
-h, --help
|
||||
Print help information
|
||||
Print help
|
||||
-V, --version
|
||||
Print version information
|
||||
Print version
|
||||
|
||||
```
|
||||
|
|
|
@ -7,8 +7,8 @@ Usage: 02_apps[EXE] --two <VALUE> --one <VALUE>
|
|||
Options:
|
||||
--two <VALUE>
|
||||
--one <VALUE>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 02_apps --version
|
||||
MyApp 1.0
|
||||
|
|
|
@ -7,8 +7,8 @@ Usage: 02_crate[EXE] --two <VALUE> --one <VALUE>
|
|||
Options:
|
||||
--two <VALUE>
|
||||
--one <VALUE>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 02_crate --version
|
||||
clap [..]
|
||||
|
|
|
@ -6,8 +6,8 @@ Usage: 03_01_flag_bool[EXE] [OPTIONS]
|
|||
|
||||
Options:
|
||||
-v, --verbose
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_01_flag_bool
|
||||
verbose: false
|
||||
|
|
|
@ -6,8 +6,8 @@ Usage: 03_01_flag_count[EXE] [OPTIONS]
|
|||
|
||||
Options:
|
||||
-v, --verbose...
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_01_flag_count
|
||||
verbose: 0
|
||||
|
|
|
@ -6,8 +6,8 @@ Usage: 03_02_option[EXE] [OPTIONS]
|
|||
|
||||
Options:
|
||||
-n, --name <name>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_02_option
|
||||
name: None
|
||||
|
|
|
@ -6,8 +6,8 @@ Usage: 03_02_option_mult[EXE] [OPTIONS]
|
|||
|
||||
Options:
|
||||
-n, --name <name>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_02_option_mult
|
||||
name: None
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
[name]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_03_positional
|
||||
name: None
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
[name]...
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_03_positional_mult
|
||||
names: []
|
||||
|
|
|
@ -9,8 +9,8 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_04_subcommands help add
|
||||
Adds files to myapp
|
||||
|
@ -21,8 +21,8 @@ Arguments:
|
|||
[NAME]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_04_subcommands add bob
|
||||
'myapp add' was used, name is: Some("bob")
|
||||
|
@ -42,8 +42,8 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
[PORT] [default: 2020]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_05_default_values
|
||||
port: 2020
|
||||
|
|
|
@ -14,10 +14,10 @@ Arguments:
|
|||
|
||||
Options:
|
||||
-h, --help
|
||||
Print help information (use `-h` for a summary)
|
||||
Print help (see a summary with '-h')
|
||||
|
||||
-V, --version
|
||||
Print version information
|
||||
Print version
|
||||
|
||||
$ 04_01_enum -h
|
||||
A simple to use, efficient, and full-featured Command Line Argument Parser
|
||||
|
@ -28,8 +28,8 @@ Arguments:
|
|||
<MODE> What mode to run the program in [possible values: fast, slow]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information (use `--help` for more detail)
|
||||
-V, --version Print version information
|
||||
-h, --help Print help (see more with '--help')
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_01_enum fast
|
||||
Hare
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
<MODE> What mode to run the program in [possible values: fast, slow]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_01_possible fast
|
||||
Hare
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
<PORT> Network port to use
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_02_parse 22
|
||||
PORT = 22
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
<PORT> Network port to use
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_02_validate 22
|
||||
PORT = 22
|
||||
|
|
|
@ -14,8 +14,8 @@ Options:
|
|||
--patch auto inc patch
|
||||
--spec-in <SPEC_IN> some special input argument
|
||||
-c <CONFIG>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_03_relations
|
||||
? failed
|
||||
|
|
|
@ -14,8 +14,8 @@ Options:
|
|||
--patch auto inc patch
|
||||
--spec-in <SPEC_IN> some special input argument
|
||||
-c <CONFIG>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_04_custom
|
||||
? failed
|
||||
|
|
|
@ -14,8 +14,8 @@ Arguments:
|
|||
Options:
|
||||
-c, --config <FILE> Sets a custom config file
|
||||
-d, --debug... Turn debugging information on
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ Options:
|
|||
--one <ONE>
|
||||
|
||||
-h, --help
|
||||
Print help information
|
||||
Print help
|
||||
-V, --version
|
||||
Print version information
|
||||
Print version
|
||||
|
||||
```
|
||||
|
|
|
@ -7,8 +7,8 @@ Usage: 02_apps_derive[EXE] --two <TWO> --one <ONE>
|
|||
Options:
|
||||
--two <TWO>
|
||||
--one <ONE>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 02_apps_derive --version
|
||||
MyApp 1.0
|
||||
|
|
|
@ -7,8 +7,8 @@ Usage: 02_crate_derive[EXE] --two <TWO> --one <ONE>
|
|||
Options:
|
||||
--two <TWO>
|
||||
--one <ONE>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 02_crate_derive --version
|
||||
clap [..]
|
||||
|
|
|
@ -6,8 +6,8 @@ Usage: 03_01_flag_bool_derive[EXE] [OPTIONS]
|
|||
|
||||
Options:
|
||||
-v, --verbose
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_01_flag_bool_derive
|
||||
verbose: false
|
||||
|
|
|
@ -6,8 +6,8 @@ Usage: 03_01_flag_count_derive[EXE] [OPTIONS]
|
|||
|
||||
Options:
|
||||
-v, --verbose...
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_01_flag_count_derive
|
||||
verbose: 0
|
||||
|
|
|
@ -6,8 +6,8 @@ Usage: 03_02_option_derive[EXE] [OPTIONS]
|
|||
|
||||
Options:
|
||||
-n, --name <NAME>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_02_option_derive
|
||||
name: None
|
||||
|
|
|
@ -6,8 +6,8 @@ Usage: 03_02_option_mult_derive[EXE] [OPTIONS]
|
|||
|
||||
Options:
|
||||
-n, --name <NAME>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_02_option_mult_derive
|
||||
name: []
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
[NAME]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_03_positional_derive
|
||||
name: None
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
[NAME]...
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_03_positional_mult_derive
|
||||
name: []
|
||||
|
|
|
@ -9,8 +9,8 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_04_subcommands_derive help add
|
||||
Adds files to myapp
|
||||
|
@ -21,8 +21,8 @@ Arguments:
|
|||
[NAME]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_04_subcommands_derive add bob
|
||||
'myapp add' was used, name is: Some("bob")
|
||||
|
@ -42,8 +42,8 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
[PORT] [default: 2020]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 03_05_default_values_derive
|
||||
port: 2020
|
||||
|
|
|
@ -14,10 +14,10 @@ Arguments:
|
|||
|
||||
Options:
|
||||
-h, --help
|
||||
Print help information (use `-h` for a summary)
|
||||
Print help (see a summary with '-h')
|
||||
|
||||
-V, --version
|
||||
Print version information
|
||||
Print version
|
||||
|
||||
$ 04_01_enum_derive -h
|
||||
A simple to use, efficient, and full-featured Command Line Argument Parser
|
||||
|
@ -28,8 +28,8 @@ Arguments:
|
|||
<MODE> What mode to run the program in [possible values: fast, slow]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information (use `--help` for more detail)
|
||||
-V, --version Print version information
|
||||
-h, --help Print help (see more with '--help')
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_01_enum_derive fast
|
||||
Hare
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
<PORT> Network port to use
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_02_parse_derive 22
|
||||
PORT = 22
|
||||
|
|
|
@ -8,8 +8,8 @@ Arguments:
|
|||
<PORT> Network port to use
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_02_validate_derive 22
|
||||
PORT = 22
|
||||
|
|
|
@ -14,8 +14,8 @@ Options:
|
|||
--patch auto inc patch
|
||||
--spec-in <SPEC_IN> some special input argument
|
||||
-c <CONFIG>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_03_relations_derive
|
||||
? failed
|
||||
|
|
|
@ -14,8 +14,8 @@ Options:
|
|||
--patch auto inc patch
|
||||
--spec-in <SPEC_IN> some special input argument
|
||||
-c <CONFIG>
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
|
||||
$ 04_04_custom_derive
|
||||
? failed
|
||||
|
|
|
@ -13,7 +13,7 @@ Options:
|
|||
-D <DEFINES> Hand-written parser for tuples
|
||||
--port <PORT> Support for discrete numbers [default: 22] [possible values: 22, 80]
|
||||
--log-level <LOG_LEVEL> Support enums from a foreign crate that don't implement `ValueEnum` [default: info] [possible values: info, debug, info, warn, error]
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -2641,8 +2641,8 @@ impl Command {
|
|||
/// alpha Some help and text
|
||||
///
|
||||
/// Options:
|
||||
/// -h, --help Print help information
|
||||
/// -V, --version Print version information
|
||||
/// -h, --help Print help
|
||||
/// -V, --version Print version
|
||||
/// ```
|
||||
#[inline]
|
||||
#[must_use]
|
||||
|
@ -3105,8 +3105,8 @@ impl Command {
|
|||
/// sub1
|
||||
///
|
||||
/// Options:
|
||||
/// -h, --help Print help information
|
||||
/// -V, --version Print version information
|
||||
/// -h, --help Print help
|
||||
/// -V, --version Print version
|
||||
/// ```
|
||||
///
|
||||
/// but usage of `subcommand_value_name`
|
||||
|
@ -3132,8 +3132,8 @@ impl Command {
|
|||
/// sub1
|
||||
///
|
||||
/// Options:
|
||||
/// -h, --help Print help information
|
||||
/// -V, --version Print version information
|
||||
/// -h, --help Print help
|
||||
/// -V, --version Print version
|
||||
/// ```
|
||||
#[must_use]
|
||||
pub fn subcommand_value_name(mut self, value_name: impl IntoResettable<Str>) -> Self {
|
||||
|
@ -3169,8 +3169,8 @@ impl Command {
|
|||
/// sub1
|
||||
///
|
||||
/// Options:
|
||||
/// -h, --help Print help information
|
||||
/// -V, --version Print version information
|
||||
/// -h, --help Print help
|
||||
/// -V, --version Print version
|
||||
/// ```
|
||||
///
|
||||
/// but usage of `subcommand_help_heading`
|
||||
|
@ -3196,8 +3196,8 @@ impl Command {
|
|||
/// sub1
|
||||
///
|
||||
/// Options:
|
||||
/// -h, --help Print help information
|
||||
/// -V, --version Print version information
|
||||
/// -h, --help Print help
|
||||
/// -V, --version Print version
|
||||
/// ```
|
||||
#[must_use]
|
||||
pub fn subcommand_help_heading(mut self, heading: impl IntoResettable<Str>) -> Self {
|
||||
|
@ -4243,10 +4243,10 @@ impl Command {
|
|||
.action(ArgAction::Help);
|
||||
if self.long_help_exists {
|
||||
arg = arg
|
||||
.help("Print help information (use `--help` for more detail)")
|
||||
.long_help("Print help information (use `-h` for a summary)");
|
||||
.help("Print help (see more with '--help')")
|
||||
.long_help("Print help (see a summary with '-h')");
|
||||
} else {
|
||||
arg = arg.help("Print help information");
|
||||
arg = arg.help("Print help");
|
||||
}
|
||||
// Avoiding `arg_internal` to not be sensitive to `next_help_heading` /
|
||||
// `next_display_order`
|
||||
|
@ -4258,7 +4258,7 @@ impl Command {
|
|||
.short('V')
|
||||
.long("version")
|
||||
.action(ArgAction::Version)
|
||||
.help("Print version information");
|
||||
.help("Print version");
|
||||
// Avoiding `arg_internal` to not be sensitive to `next_help_heading` /
|
||||
// `next_display_order`
|
||||
self.args.push(arg);
|
||||
|
|
|
@ -8,8 +8,8 @@ static ALLOW_EXT_SC: &str = "\
|
|||
Usage: clap-test [COMMAND]
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
static DONT_COLLAPSE_ARGS: &str = "\
|
||||
|
@ -21,8 +21,8 @@ Arguments:
|
|||
[arg3] some
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
#[test]
|
||||
|
@ -144,8 +144,8 @@ Usage: test [OPTIONS]
|
|||
|
||||
Options:
|
||||
-i, --info Provides more info
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("test")
|
||||
|
@ -306,8 +306,8 @@ Arguments:
|
|||
|
||||
Options:
|
||||
-o, --opt <opt> some option
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("test")
|
||||
|
@ -638,8 +638,8 @@ Usage: clap-test --opt=<FILE>
|
|||
|
||||
Options:
|
||||
-o, --opt=<FILE> some
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("clap-test").version("v1.4.8").arg(
|
||||
|
|
|
@ -198,8 +198,8 @@ Usage: ct test [OPTIONS]
|
|||
Options:
|
||||
-o, --opt <opt>
|
||||
-f, --flag
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("ct").author("Salim Afiune").subcommand(
|
||||
|
@ -228,8 +228,8 @@ Usage: ct test [OPTIONS]
|
|||
Options:
|
||||
-o, --opt <opt> [aliases: visible]
|
||||
-f, --flag [aliases: v_flg, flag2, flg3]
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("ct").author("Salim Afiune").subcommand(
|
||||
|
|
|
@ -165,8 +165,8 @@ Usage: ct test [OPTIONS]
|
|||
Options:
|
||||
-o, --opt <opt>
|
||||
-f, --flag
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("ct").author("Salim Afiune").subcommand(
|
||||
|
@ -195,8 +195,8 @@ Usage: ct test [OPTIONS]
|
|||
Options:
|
||||
-o, --opt <opt> [short aliases: v]
|
||||
-f, --flag [aliases: flag1] [short aliases: a, b, 🦆]
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("ct").author("Salim Afiune").subcommand(
|
||||
|
|
|
@ -12,8 +12,8 @@ A simple to use, efficient, and full-featured Command Line Argument Parser
|
|||
Usage: prog
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
static AUTHORS_ONLY: &str = "prog 1
|
||||
|
@ -22,8 +22,8 @@ static AUTHORS_ONLY: &str = "prog 1
|
|||
Usage: prog
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -10,8 +10,8 @@ A simple to use, efficient, and full-featured Command Line Argument Parser
|
|||
Usage: clap
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -12,10 +12,10 @@ Usage: test [OPTIONS]
|
|||
Options:
|
||||
--flag_a second flag
|
||||
--flag_b first flag
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
--option_a <option_a> second option
|
||||
--option_b <option_b> first option
|
||||
-V, --version Print version information
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("test")
|
||||
|
@ -53,8 +53,8 @@ Options:
|
|||
--option_b <option_b> first option
|
||||
--flag_a second flag
|
||||
--option_a <option_a> second option
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("test").version("1.2").args([
|
||||
|
@ -87,8 +87,8 @@ Usage: test [OPTIONS]
|
|||
Options:
|
||||
--flag_b first flag
|
||||
--option_b <option_b> first option
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
--flag_a second flag
|
||||
--option_a <option_a> second option
|
||||
";
|
||||
|
@ -133,10 +133,10 @@ Usage: test [OPTIONS]
|
|||
Options:
|
||||
--flag_a first flag
|
||||
--flag_b second flag
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
--option_a <option_a> first option
|
||||
--option_b <option_b> second option
|
||||
-V, --version Print version information
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("test")
|
||||
|
@ -180,8 +180,8 @@ Options:
|
|||
--option_b <option_b> first option
|
||||
--flag_a second flag
|
||||
--option_a <option_a> second option
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("test").subcommand(
|
||||
|
@ -218,8 +218,8 @@ Options:
|
|||
--flag_b first flag
|
||||
--option_b <option_b> first option
|
||||
--option_a <option_a> second option
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let cmd = Command::new("test").subcommand(
|
||||
|
@ -263,8 +263,8 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let app_subcmd_alpha_order = Command::new("test")
|
||||
|
@ -298,8 +298,8 @@ Commands:
|
|||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-V, --version Print version information
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
";
|
||||
|
||||
let app_subcmd_decl_order = Command::new("test").version("1").subcommands(vec![
|
||||
|
|
|
@ -17,7 +17,7 @@ Commands:
|
|||
sub
|
||||
|
||||
Options:
|
||||
-h, --help Print help information
|
||||
-h, --help Print help
|
||||
",
|
||||
false,
|
||||
);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue