Skip to content

Commit

Permalink
fix: fixes a panic when using global args and calling App::get_matche…
Browse files Browse the repository at this point in the history
…s_from_safe_borrow multiple times

Closes #1076
  • Loading branch information
kbknapp committed Oct 24, 2017
1 parent 6ac846d commit d86ec79
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1586,9 +1586,12 @@ impl<'a, 'b> App<'a, 'b> {
{
// If there are global arguments, or settings we need to propgate them down to subcommands
// before parsing incase we run into a subcommand
self.p.propagate_globals();
self.p.propagate_settings();
self.p.derive_display_order();
if !self.p.is_set(AppSettings::Propagated) {
self.p.propagate_globals();
self.p.propagate_settings();
self.p.derive_display_order();
self.p.set(AppSettings::Propagated);
}

let mut matcher = ArgMatcher::new();

Expand Down

0 comments on commit d86ec79

Please sign in to comment.