mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
Use about() with help() and long_about() with long_help()
This commit is contained in:
parent
fc359e3c46
commit
9cde072b61
2 changed files with 6 additions and 5 deletions
|
@ -821,12 +821,13 @@ impl<'b, 'c, 'd, 'w> Help<'b, 'c, 'd, 'w> {
|
|||
if let Some(author) = self.parser.app.author {
|
||||
write_thing!(author)
|
||||
}
|
||||
if let Some(about) = self.parser.app.long_about {
|
||||
|
||||
if self.use_long && self.parser.app.long_about.is_some() {
|
||||
debugln!("Help::write_default_help: writing long about");
|
||||
write_thing!(about)
|
||||
} else if let Some(about) = self.parser.app.about {
|
||||
write_thing!(self.parser.app.long_about.unwrap())
|
||||
} else if self.parser.app.about.is_some() {
|
||||
debugln!("Help::write_default_help: writing about");
|
||||
write_thing!(about)
|
||||
write_thing!(self.parser.app.about.unwrap())
|
||||
}
|
||||
|
||||
self.color(Format::Warning("\nUSAGE:"))?;
|
||||
|
|
|
@ -1496,7 +1496,7 @@ fn show_long_about_issue_897() {
|
|||
}
|
||||
|
||||
static ISSUE_897_SHORT: &str = "ctest-foo 0.1
|
||||
Long about foo
|
||||
About foo
|
||||
|
||||
USAGE:
|
||||
ctest foo
|
||||
|
|
Loading…
Reference in a new issue