mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-21 15:13:48 -07:00
argv: update clap to 2.29.4
We use the new AppSettings::AllArgsOverrideSelf to permit all flags to be specified multiple times. This removes the need for our previous work-around where we would enable `multiple` for every flag and then just extract the last value when consuming clap's matches. We also add a couple regression tests that ensure repeated switches and flags work as expected.
This commit is contained in:
@@ -994,7 +994,7 @@ impl<'a> ArgMatches<'a> {
|
||||
}
|
||||
|
||||
fn value_of_lossy(&self, name: &str) -> Option<String> {
|
||||
self.values_of_lossy(name).and_then(|mut vals| vals.pop())
|
||||
self.0.value_of_lossy(name).map(|s| s.into_owned())
|
||||
}
|
||||
|
||||
fn values_of_lossy(&self, name: &str) -> Option<Vec<String>> {
|
||||
@@ -1002,7 +1002,7 @@ impl<'a> ArgMatches<'a> {
|
||||
}
|
||||
|
||||
fn value_of_os(&'a self, name: &str) -> Option<&'a OsStr> {
|
||||
self.values_of_os(name).and_then(|it| it.last())
|
||||
self.0.value_of_os(name)
|
||||
}
|
||||
|
||||
fn values_of_os(&'a self, name: &str) -> Option<clap::OsValues<'a>> {
|
||||
|
Reference in New Issue
Block a user