Use about() with help() and long_about() with long_help()

This commit is contained in:
Brooks J Rady 2020-02-13 00:31:45 +00:00
parent fc359e3c46
commit 9cde072b61
2 changed files with 6 additions and 5 deletions

View file

@ -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:"))?;

View file

@ -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