Skip to content

Commit

Permalink
fix: Fixes a regression where --help couldn't be overridden
Browse files Browse the repository at this point in the history
Closes #1112
  • Loading branch information
kbknapp committed Nov 22, 2017
1 parent a224cdc commit a283d69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down Expand Up @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions src/app/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a283d69

Please sign in to comment.