mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
fix(help): Take long_help into account for next_line_help detection
This commit is contained in:
parent
88fb46ef3e
commit
22148eb87d
1 changed files with 8 additions and 2 deletions
|
@ -755,7 +755,10 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
// force_next_line
|
// 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 h_w = h.display_width() + display_width(spec_vals);
|
||||||
let taken = if arg.is_positional() {
|
let taken = if arg.is_positional() {
|
||||||
longest + TAB_WIDTH * 2
|
longest + TAB_WIDTH * 2
|
||||||
|
@ -1067,7 +1070,10 @@ impl<'cmd, 'writer> HelpTemplate<'cmd, 'writer> {
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
// force_next_line
|
// 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 h_w = h.display_width() + display_width(spec_vals);
|
||||||
let taken = longest + TAB_WIDTH * 2;
|
let taken = longest + TAB_WIDTH * 2;
|
||||||
self.term_w >= taken
|
self.term_w >= taken
|
||||||
|
|
Loading…
Reference in a new issue