Skip to content

Commit

Permalink
refactor(parser): Reduce code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Oct 12, 2022
1 parent 84828e8 commit 8cf6d11
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/parser/parser.rs
Expand Up @@ -1506,14 +1506,7 @@ impl<'cmd> Parser<'cmd> {

/// Increase occurrence of specific argument and the grouped arg it's in.
fn start_occurrence_of_arg(&self, matcher: &mut ArgMatcher, arg: &Arg) {
// With each new occurrence, remove overrides from prior occurrences
self.remove_overrides(arg, matcher);

matcher.start_custom_arg(arg, ValueSource::CommandLine);
// Increment or create the group "args"
for group in self.cmd.groups_for_arg(arg.get_id()) {
matcher.start_custom_group(group, ValueSource::CommandLine);
}
self.start_custom_arg(matcher, arg, ValueSource::CommandLine);
}
}

Expand Down

0 comments on commit 8cf6d11

Please sign in to comment.