Skip to content

Commit

Permalink
fix: fixes issue where before_help wasn't printed
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed May 31, 2016
1 parent 84029ab commit b3faff6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/help.rs
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
}

Expand Down

0 comments on commit b3faff6

Please sign in to comment.