Skip to content

Commit

Permalink
Merge pull request #4902 from epage/sub
Browse files Browse the repository at this point in the history
fix(help): Don't use next-line-help on long-help for subcommands
  • Loading branch information
epage committed May 19, 2023
2 parents d597cf7 + c3fe7ff commit 65d44aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion clap_builder/src/output/help_template.rs
Expand Up @@ -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 {
Expand Down
6 changes: 2 additions & 4 deletions tests/ui/help_cmd_stdout.toml
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions tests/ui/help_flag_stdout.toml
Expand Up @@ -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
Expand Down

0 comments on commit 65d44aa

Please sign in to comment.