fix: fixes a panic when using global args and calling App::get_matches_from_safe_borrow multiple times

Closes #1076
This commit is contained in:
Kevin K 2017-10-24 10:45:00 -04:00
parent 6ac846d850
commit d86ec79742
No known key found for this signature in database
GPG key ID: 17218E4B3692F01A

View file

@ -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
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();