mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
fix(parser): Force multiple occurrences with new Actions
This is needed for deprecate `multiple_occurrences`
This commit is contained in:
parent
d88ca13730
commit
7980c5ceb8
1 changed files with 15 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue