fix: Fixes a regression where --help couldn't be overridden

Closes #1112
This commit is contained in:
Kevin K 2017-11-22 04:09:02 -05:00
parent a224cdcc87
commit a283d69fc0
No known key found for this signature in database
GPG key ID: 17218E4B3692F01A
2 changed files with 3 additions and 1 deletions

View file

@ -75,6 +75,7 @@ impl<'a, 'b> Parser<'a, 'b>
pub fn with_name(n: String) -> Self {
Parser {
meta: AppMeta::with_name(n),
g_settings: AppFlags::zeroed(),
..Default::default()
}
}
@ -1811,7 +1812,7 @@ impl<'a, 'b> Parser<'a, 'b>
}
Ok(())
}
pub fn add_env(&mut self, matcher: &mut ArgMatcher<'a>) -> ClapResult<()> {
macro_rules! add_val {
($_self:ident, $a:ident, $m:ident) => {

View file

@ -67,6 +67,7 @@ impl Default for AppFlags {
#[allow(deprecated)]
impl AppFlags {
pub fn new() -> Self { AppFlags::default() }
pub fn zeroed() -> Self { AppFlags(Flags::empty()) }
impl_settings! { AppSettings,
ArgRequiredElseHelp => Flags::A_REQUIRED_ELSE_HELP,