fix(parser): Force multiple occurrences with new Actions

This is needed for deprecate `multiple_occurrences`
This commit is contained in:
Ed Page 2022-06-07 14:34:50 -05:00
parent d88ca13730
commit 7980c5ceb8

View file

@ -4847,6 +4847,21 @@ impl<'help> Arg<'help> {
} else {
self.settings.unset(ArgSettings::TakesValue);
}
match action {
ArgAction::StoreValue
| ArgAction::IncOccurrence
| ArgAction::Help
| ArgAction::Version => {}
ArgAction::Set
| ArgAction::Append
| ArgAction::SetTrue
| ArgAction::SetFalse
| ArgAction::Count => {
if !self.is_positional() {
self.settings.set(ArgSettings::MultipleOccurrences);
}
}
}
}
if self.value_parser.is_none() {