mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
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:
parent
6ac846d850
commit
d86ec79742
1 changed files with 6 additions and 3 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue