Skip to content

Commit

Permalink
Merge pull request #5494 from epage/next
Browse files Browse the repository at this point in the history
fix(help): Take long_help into account for next_line_help detection
  • Loading branch information
epage committed May 14, 2024
2 parents 88fb46e + 22148eb commit 10a62de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions clap_builder/src/output/help_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,10 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> {
true
} else {
// force_next_line
let h = arg.get_help().unwrap_or_default();
let h = arg
.get_help()
.or_else(|| arg.get_long_help())
.unwrap_or_default();
let h_w = h.display_width() + display_width(spec_vals);
let taken = if arg.is_positional() {
longest + TAB_WIDTH * 2
Expand Down Expand Up @@ -1067,7 +1070,10 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> {
true
} else {
// force_next_line
let h = cmd.get_about().unwrap_or_default();
let h = cmd
.get_about()
.or_else(|| cmd.get_long_about())
.unwrap_or_default();
let h_w = h.display_width() + display_width(spec_vals);
let taken = longest + TAB_WIDTH * 2;
self.term_w >= taken
Expand Down

0 comments on commit 10a62de

Please sign in to comment.