mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 23:37:32 +00:00
fix: fixes issue where before_help wasn't printed
This commit is contained in:
parent
84029aba18
commit
b3faff6030
1 changed files with 7 additions and 0 deletions
|
@ -551,6 +551,10 @@ impl<'a> Help<'a> {
|
|||
|
||||
/// Writes default help for a Parser Object to the wrapped stream.
|
||||
pub fn write_default_help(&mut self, parser: &Parser) -> ClapResult<()> {
|
||||
if let Some(h) = parser.meta.pre_help {
|
||||
try!(write!(self.writer, "{}", h));
|
||||
try!(self.writer.write(b"\n\n"));
|
||||
}
|
||||
|
||||
// Print the version
|
||||
try!(self.write_bin_name(&parser));
|
||||
|
@ -580,6 +584,9 @@ impl<'a> Help<'a> {
|
|||
}
|
||||
|
||||
if let Some(h) = parser.meta.more_help {
|
||||
if flags || opts || pos || subcmds {
|
||||
try!(self.writer.write(b"\n\n"));
|
||||
}
|
||||
try!(write!(self.writer, "{}", h));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue