fix(usage): fixes a big regression with custom usage strings

This commit is contained in:
Kevin K 2017-03-23 23:51:03 -04:00
parent cc1985b6d8
commit a442211b39
2 changed files with 2 additions and 2 deletions

View file

@ -691,7 +691,7 @@ impl<'a> Help<'a> {
try!(write!(self.writer,
"\n{}{}\n\n",
TAB,
usage::create_help_usage(parser, true)));
usage::create_usage_no_title(parser, &[])));
let flags = parser.has_flags();
let pos = parser.has_positionals();

View file

@ -43,7 +43,7 @@ pub fn create_error_usage<'a, 'b>(p: &Parser<'a, 'b>,
}
// Creates a usage string (*without title*) if one was not provided by the user manually.
fn create_usage_no_title(p: &Parser, used: &[&str]) -> String {
pub fn create_usage_no_title(p: &Parser, used: &[&str]) -> String {
debugln!("usage::create_usage_no_title;");
if let Some(u) = p.meta.usage_str {
String::from(&*u)