mirror of
https://github.com/clap-rs/clap
synced 2024-12-04 18:19:13 +00:00
fix(help): Don't use next-line-help on long-help for subcommands
Subcommands don't switch their behavior on `--help`, so let's not switch to next-line-help based on `--help`. Fixes #4897
This commit is contained in:
parent
d597cf7bd6
commit
c3fe7ff0a9
3 changed files with 6 additions and 9 deletions
|
@ -963,7 +963,8 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> {
|
|||
}
|
||||
|
||||
fn subcommand_next_line_help(&self, cmd: &Command, spec_vals: &str, longest: usize) -> bool {
|
||||
if self.next_line_help | self.use_long {
|
||||
// Ignore `self.use_long` since subcommands are only shown as short help
|
||||
if self.next_line_help {
|
||||
// setting_next_line
|
||||
true
|
||||
} else {
|
||||
|
|
|
@ -6,9 +6,7 @@ Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND]
|
|||
|
||||
Commands:
|
||||
more
|
||||
|
||||
help
|
||||
Print this message or the help of the given subcommand(s)
|
||||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
--verbose
|
||||
|
|
|
@ -6,9 +6,7 @@ Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND]
|
|||
|
||||
Commands:
|
||||
more
|
||||
|
||||
help
|
||||
Print this message or the help of the given subcommand(s)
|
||||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
--verbose
|
||||
|
|
Loading…
Reference in a new issue