diff --git a/src/parser/arg_matcher.rs b/src/parser/arg_matcher.rs index 65102c2bc6f..1b04087f0d8 100644 --- a/src/parser/arg_matcher.rs +++ b/src/parser/arg_matcher.rs @@ -153,20 +153,11 @@ impl ArgMatcher { } pub(crate) fn start_occurrence_of_arg(&mut self, arg: &Arg) { - let id = arg.get_id().clone(); - debug!("ArgMatcher::start_occurrence_of_arg: id={:?}", id); - let ma = self.entry(id).or_insert(MatchedArg::new_arg(arg)); - debug_assert_eq!(ma.type_id(), Some(arg.get_value_parser().type_id())); - ma.set_source(ValueSource::CommandLine); - ma.new_val_group(); + self.start_custom_arg(arg, ValueSource::CommandLine); } pub(crate) fn start_occurrence_of_group(&mut self, id: Id) { - debug!("ArgMatcher::start_occurrence_of_group: id={:?}", id); - let ma = self.entry(id).or_insert(MatchedArg::new_group()); - debug_assert_eq!(ma.type_id(), None); - ma.set_source(ValueSource::CommandLine); - ma.new_val_group(); + self.start_custom_group(id, ValueSource::CommandLine); } pub(crate) fn start_occurrence_of_external(&mut self, cmd: &crate::Command) {