diff --git a/clap_complete/tests/snapshots/basic.elvish b/clap_complete/tests/snapshots/basic.elvish index 8d1f725effa..b9736473b8e 100644 --- a/clap_complete/tests/snapshots/basic.elvish +++ b/clap_complete/tests/snapshots/basic.elvish @@ -22,7 +22,8 @@ set edit:completion:arg-completer[my-app] = {|@words| cand -v 'v' cand -h 'Print help' cand --help 'Print help' - cand test 'Subcommand' + cand test 'Subcommand +with a second line' cand help 'Print this message or the help of the given subcommand(s)' } &'my-app;test'= { @@ -32,7 +33,8 @@ set edit:completion:arg-completer[my-app] = {|@words| cand --help 'Print help' } &'my-app;help'= { - cand test 'Subcommand' + cand test 'Subcommand +with a second line' cand help 'Print this message or the help of the given subcommand(s)' } &'my-app;help;test'= { diff --git a/clap_complete/tests/snapshots/basic.fish b/clap_complete/tests/snapshots/basic.fish index 43cd26d430a..e269f6e1b33 100644 --- a/clap_complete/tests/snapshots/basic.fish +++ b/clap_complete/tests/snapshots/basic.fish @@ -1,10 +1,12 @@ 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' -complete -c my-app -n "__fish_use_subcommand" -f -a "test" -d 'Subcommand' +complete -c my-app -n "__fish_use_subcommand" -f -a "test" -d 'Subcommand +with a second line' 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' -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 "test" -d 'Subcommand +with a second line' 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)' diff --git a/clap_complete/tests/snapshots/basic.ps1 b/clap_complete/tests/snapshots/basic.ps1 index 5cb77fa058a..d561b8bdda0 100644 --- a/clap_complete/tests/snapshots/basic.ps1 +++ b/clap_complete/tests/snapshots/basic.ps1 @@ -25,7 +25,8 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock { [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'v') [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('test', 'test', [CompletionResultType]::ParameterValue, 'Subcommand +with a second line') [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') break } @@ -37,7 +38,8 @@ Register-ArgumentCompleter -Native -CommandName 'my-app' -ScriptBlock { break } 'my-app;help' { - [CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'Subcommand') + [CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'Subcommand +with a second line') [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') break } diff --git a/clap_complete/tests/snapshots/basic.zsh b/clap_complete/tests/snapshots/basic.zsh index 408bb7e4b8d..0a0e4cfe2ea 100644 --- a/clap_complete/tests/snapshots/basic.zsh +++ b/clap_complete/tests/snapshots/basic.zsh @@ -68,7 +68,8 @@ esac (( $+functions[_my-app_commands] )) || _my-app_commands() { local commands; commands=( -'test:Subcommand' \ +'test:Subcommand +with a second line' \ 'help:Print this message or the help of the given subcommand(s)' \ ) _describe -t commands 'my-app commands' commands "$@" @@ -76,7 +77,8 @@ _my-app_commands() { (( $+functions[_my-app__help_commands] )) || _my-app__help_commands() { local commands; commands=( -'test:Subcommand' \ +'test:Subcommand +with a second line' \ 'help:Print this message or the help of the given subcommand(s)' \ ) _describe -t commands 'my-app help commands' commands "$@" diff --git a/clap_complete/tests/snapshots/custom_bin_name.elvish b/clap_complete/tests/snapshots/custom_bin_name.elvish index 734c6cb3e3a..80b6bf5f10d 100644 --- a/clap_complete/tests/snapshots/custom_bin_name.elvish +++ b/clap_complete/tests/snapshots/custom_bin_name.elvish @@ -22,7 +22,8 @@ set edit:completion:arg-completer[bin-name] = {|@words| cand -v 'v' cand -h 'Print help' cand --help 'Print help' - cand test 'Subcommand' + cand test 'Subcommand +with a second line' cand help 'Print this message or the help of the given subcommand(s)' } &'bin-name;test'= { @@ -32,7 +33,8 @@ set edit:completion:arg-completer[bin-name] = {|@words| cand --help 'Print help' } &'bin-name;help'= { - cand test 'Subcommand' + cand test 'Subcommand +with a second line' cand help 'Print this message or the help of the given subcommand(s)' } &'bin-name;help;test'= { diff --git a/clap_complete/tests/snapshots/custom_bin_name.fish b/clap_complete/tests/snapshots/custom_bin_name.fish index 5652ac0aab0..a75e468e018 100644 --- a/clap_complete/tests/snapshots/custom_bin_name.fish +++ b/clap_complete/tests/snapshots/custom_bin_name.fish @@ -1,10 +1,12 @@ complete -c bin-name -n "__fish_use_subcommand" -s c complete -c bin-name -n "__fish_use_subcommand" -s v complete -c bin-name -n "__fish_use_subcommand" -s h -l help -d 'Print help' -complete -c bin-name -n "__fish_use_subcommand" -f -a "test" -d 'Subcommand' +complete -c bin-name -n "__fish_use_subcommand" -f -a "test" -d 'Subcommand +with a second line' complete -c bin-name -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c bin-name -n "__fish_seen_subcommand_from test" -s d complete -c bin-name -n "__fish_seen_subcommand_from test" -s c complete -c bin-name -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help' -complete -c bin-name -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 bin-name -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 +with a second line' complete -c bin-name -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)' diff --git a/clap_complete/tests/snapshots/custom_bin_name.ps1 b/clap_complete/tests/snapshots/custom_bin_name.ps1 index d65e8c32698..bf6002be739 100644 --- a/clap_complete/tests/snapshots/custom_bin_name.ps1 +++ b/clap_complete/tests/snapshots/custom_bin_name.ps1 @@ -25,7 +25,8 @@ Register-ArgumentCompleter -Native -CommandName 'bin-name' -ScriptBlock { [CompletionResult]::new('-v', 'v', [CompletionResultType]::ParameterName, 'v') [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('test', 'test', [CompletionResultType]::ParameterValue, 'Subcommand +with a second line') [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') break } @@ -37,7 +38,8 @@ Register-ArgumentCompleter -Native -CommandName 'bin-name' -ScriptBlock { break } 'bin-name;help' { - [CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'Subcommand') + [CompletionResult]::new('test', 'test', [CompletionResultType]::ParameterValue, 'Subcommand +with a second line') [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)') break } diff --git a/clap_complete/tests/snapshots/custom_bin_name.zsh b/clap_complete/tests/snapshots/custom_bin_name.zsh index 205bd23caa1..130aebcdede 100644 --- a/clap_complete/tests/snapshots/custom_bin_name.zsh +++ b/clap_complete/tests/snapshots/custom_bin_name.zsh @@ -68,7 +68,8 @@ esac (( $+functions[_bin-name_commands] )) || _bin-name_commands() { local commands; commands=( -'test:Subcommand' \ +'test:Subcommand +with a second line' \ 'help:Print this message or the help of the given subcommand(s)' \ ) _describe -t commands 'bin-name commands' commands "$@" @@ -76,7 +77,8 @@ _bin-name_commands() { (( $+functions[_bin-name__help_commands] )) || _bin-name__help_commands() { local commands; commands=( -'test:Subcommand' \ +'test:Subcommand +with a second line' \ 'help:Print this message or the help of the given subcommand(s)' \ ) _describe -t commands 'bin-name help commands' commands "$@" diff --git a/clap_complete/tests/testsuite/common.rs b/clap_complete/tests/testsuite/common.rs index a2f13f50321..75dc4b6fb06 100644 --- a/clap_complete/tests/testsuite/common.rs +++ b/clap_complete/tests/testsuite/common.rs @@ -15,11 +15,13 @@ pub fn basic_command(name: &'static str) -> clap::Command { .action(clap::ArgAction::SetTrue), ) .subcommand( - clap::Command::new("test").about("Subcommand").arg( - clap::Arg::new("debug") - .short('d') - .action(clap::ArgAction::Count), - ), + clap::Command::new("test") + .about("Subcommand\nwith a second line") + .arg( + clap::Arg::new("debug") + .short('d') + .action(clap::ArgAction::Count), + ), ) } diff --git a/clap_complete_fig/tests/common.rs b/clap_complete_fig/tests/common.rs index afdf2a76f69..ba4db145a76 100644 --- a/clap_complete_fig/tests/common.rs +++ b/clap_complete_fig/tests/common.rs @@ -13,11 +13,13 @@ pub fn basic_command(name: &'static str) -> clap::Command { .action(clap::ArgAction::SetTrue), ) .subcommand( - clap::Command::new("test").about("Subcommand").arg( - clap::Arg::new("debug") - .short('d') - .action(clap::ArgAction::Count), - ), + clap::Command::new("test") + .about("Subcommand\nwith a second line") + .arg( + clap::Arg::new("debug") + .short('d') + .action(clap::ArgAction::Count), + ), ) } diff --git a/clap_complete_fig/tests/snapshots/basic.fig.js b/clap_complete_fig/tests/snapshots/basic.fig.js index 301e489bf7f..5c9b929c57a 100644 --- a/clap_complete_fig/tests/snapshots/basic.fig.js +++ b/clap_complete_fig/tests/snapshots/basic.fig.js @@ -4,7 +4,7 @@ const completion: Fig.Spec = { subcommands: [ { name: "test", - description: "Subcommand", + description: "Subcommand with a second line", options: [ { name: "-d", @@ -25,7 +25,7 @@ const completion: Fig.Spec = { subcommands: [ { name: "test", - description: "Subcommand", + description: "Subcommand with a second line", }, { name: "help", diff --git a/clap_complete_nushell/tests/common.rs b/clap_complete_nushell/tests/common.rs index 343e7307de6..83ff466ef07 100644 --- a/clap_complete_nushell/tests/common.rs +++ b/clap_complete_nushell/tests/common.rs @@ -18,7 +18,7 @@ pub fn basic_command(name: &'static str) -> Command { ) .subcommand( Command::new("test") - .about("Subcommand") + .about("Subcommand\nwith a second line") .arg(Arg::new("debug").short('d').action(ArgAction::Count)), ) } @@ -36,7 +36,7 @@ pub fn feature_sample_command(name: &'static str) -> Command { .arg( Arg::new("config") .action(ArgAction::Count) - .help("some config file") + .help("some config file\nwith another line") .short('c') .visible_short_alias('C') .long("config") diff --git a/clap_complete_nushell/tests/snapshots/basic.nu b/clap_complete_nushell/tests/snapshots/basic.nu index f1d52b1fe7c..c45024d4474 100644 --- a/clap_complete_nushell/tests/snapshots/basic.nu +++ b/clap_complete_nushell/tests/snapshots/basic.nu @@ -7,6 +7,7 @@ module completions { ] # Subcommand +with a second line export extern "my-app test" [ -d -c @@ -18,6 +19,7 @@ module completions { ] # Subcommand +with a second line export extern "my-app help test" [ ] diff --git a/clap_complete_nushell/tests/snapshots/feature_sample.nu b/clap_complete_nushell/tests/snapshots/feature_sample.nu index f98c5a2bb52..696f55f6c21 100644 --- a/clap_complete_nushell/tests/snapshots/feature_sample.nu +++ b/clap_complete_nushell/tests/snapshots/feature_sample.nu @@ -8,8 +8,11 @@ module completions { export extern my-app [ file?: string # some input file --config(-c) # some config file +with another line --conf # some config file +with another line -C # some config file +with another line choice?: string@"nu-complete my-app choice" --help(-h) # Print help --version(-V) # Print version diff --git a/clap_complete_nushell/tests/snapshots/special_commands.nu b/clap_complete_nushell/tests/snapshots/special_commands.nu index fc01a39acba..5c6e0b879bc 100644 --- a/clap_complete_nushell/tests/snapshots/special_commands.nu +++ b/clap_complete_nushell/tests/snapshots/special_commands.nu @@ -8,8 +8,11 @@ module completions { export extern my-app [ file?: string # some input file --config(-c) # some config file +with another line --conf # some config file +with another line -C # some config file +with another line choice?: string@"nu-complete my-app choice" --help(-h) # Print help --version(-V) # Print version diff --git a/clap_complete_nushell/tests/snapshots/sub_subcommands.nu b/clap_complete_nushell/tests/snapshots/sub_subcommands.nu index c6e32a0b048..511d8540c73 100644 --- a/clap_complete_nushell/tests/snapshots/sub_subcommands.nu +++ b/clap_complete_nushell/tests/snapshots/sub_subcommands.nu @@ -8,8 +8,11 @@ module completions { export extern my-app [ file?: string # some input file --config(-c) # some config file +with another line --conf # some config file +with another line -C # some config file +with another line choice?: string@"nu-complete my-app choice" --help(-h) # Print help --version(-V) # Print version diff --git a/clap_mangen/tests/common.rs b/clap_mangen/tests/common.rs index 90c48103a8a..0fad276e259 100644 --- a/clap_mangen/tests/common.rs +++ b/clap_mangen/tests/common.rs @@ -15,11 +15,13 @@ pub fn basic_command(name: &'static str) -> clap::Command { .action(clap::ArgAction::SetTrue), ) .subcommand( - clap::Command::new("test").about("Subcommand").arg( - clap::Arg::new("debug") - .short('d') - .action(clap::ArgAction::Count), - ), + clap::Command::new("test") + .about("Subcommand\nwith a second line") + .arg( + clap::Arg::new("debug") + .short('d') + .action(clap::ArgAction::Count), + ), ) } diff --git a/clap_mangen/tests/snapshots/basic.bash.roff b/clap_mangen/tests/snapshots/basic.bash.roff index d92a55fa40d..e9ab64a9d6f 100644 --- a/clap_mangen/tests/snapshots/basic.bash.roff +++ b/clap_mangen/tests/snapshots/basic.bash.roff @@ -20,6 +20,7 @@ Print help .TP my\-app\-test(1) Subcommand +with a second line .TP my\-app\-help(1) Print this message or the help of the given subcommand(s)