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:
Ed Page 2023-05-12 10:41:05 +02:00
parent d597cf7bd6
commit c3fe7ff0a9
3 changed files with 6 additions and 9 deletions

View file

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

View file

@ -5,10 +5,8 @@ stdout = """
Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND]
Commands:
more
help
Print this message or the help of the given subcommand(s)
more
help Print this message or the help of the given subcommand(s)
Options:
--verbose

View file

@ -5,10 +5,8 @@ stdout = """
Usage: stdio-fixture[EXE] [OPTIONS] [COMMAND]
Commands:
more
help
Print this message or the help of the given subcommand(s)
more
help Print this message or the help of the given subcommand(s)
Options:
--verbose