fix(help): Be consistent in long/short help

This commit is contained in:
Ed Page 2023-11-09 14:31:52 -06:00
parent 66d2bcbdd4
commit 9e5f93d43f
2 changed files with 16 additions and 8 deletions

View file

@ -519,9 +519,9 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> {
cmd: subcommand,
styles: self.styles,
usage: self.usage,
next_line_help: false,
next_line_help: self.next_line_help,
term_w: self.term_w,
use_long: false,
use_long: self.use_long,
};
let args = subcommand
.get_arguments()

View file

@ -3028,11 +3028,15 @@ Options:
Print help (see a summary with '-h')
parent test:
--child <child> foo
-h, --help Print help (see more with '--help')
--child <child>
bar
-h, --help
Print help (see a summary with '-h')
parent help:
[COMMAND]... Print help for the subcommand(s)
[COMMAND]...
Print help for the subcommand(s)
";
let cmd = Command::new("parent")
.flatten_help(true)
@ -3066,11 +3070,15 @@ Options:
Print help (see a summary with '-h')
parent test:
--child <child> foo
-h, --help Print help (see more with '--help')
--child <child>
bar
-h, --help
Print help (see a summary with '-h')
parent help:
[COMMAND]... Print help for the subcommand(s)
[COMMAND]...
Print help for the subcommand(s)
";
let cmd = Command::new("parent")
.flatten_help(true)