Skip to content

Commit

Permalink
Merge pull request #5227 from epage/flat
Browse files Browse the repository at this point in the history
fix(help): Use right about when flattening
  • Loading branch information
epage committed Nov 27, 2023
2 parents 5c81df6 + 22130e3 commit 5c8f8d5
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 34 deletions.
4 changes: 2 additions & 2 deletions clap_builder/src/output/help_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,9 +909,9 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> {
*first = false;

let heading = subcommand.get_usage_name_fallback();
let about = cmd
let about = subcommand
.get_about()
.or_else(|| cmd.get_long_about())
.or_else(|| subcommand.get_long_about())
.unwrap_or_default();

let _ = write!(
Expand Down
1 change: 1 addition & 0 deletions examples/git-derive.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ git-derive[EXE] stash apply:
[STASH]

git-derive[EXE] stash help:
Print this message or the help of the given subcommand(s)
[COMMAND]... Print help for the subcommand(s)

$ git-derive stash push -h
Expand Down
1 change: 1 addition & 0 deletions examples/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ git[EXE] stash apply:
[STASH]

git[EXE] stash help:
Print this message or the help of the given subcommand(s)
[COMMAND]... Print help for the subcommand(s)

$ git stash push -h
Expand Down
Loading

0 comments on commit 5c8f8d5

Please sign in to comment.