diff options
author | Eric Nielsen <eric@amalgamar.com.br> | 2017-06-01 18:02:38 -0500 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-06-01 20:41:04 -0400 |
commit | 13235b596f93f7f0e7ce76e7967996787147e96e (patch) | |
tree | ef87bf7812aa51ec4bcddbca1443940614fa469d /src/args.rs | |
parent | 2628c8f38ee117d41a340afc87454db037b69933 (diff) |
Use uppercase for required argument names
This reverts a couple of changes introduced in 4c78ca8 and keeps the
`PATTERN` argument consistently uppercased, so error messages can look
like:
error: The following required arguments were not provided:
<PATTERN>
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/args.rs b/src/args.rs index 703ab3b5..b6f0138e 100644 --- a/src/args.rs +++ b/src/args.rs @@ -375,7 +375,7 @@ impl<'a> ArgMatches<'a> { if self.is_present("file") || self.is_present("files") || self.is_present("regexp") { - if let Some(path) = self.value_of_os("pattern") { + if let Some(path) = self.value_of_os("PATTERN") { paths.insert(0, Path::new(path).to_path_buf()); } } @@ -438,7 +438,7 @@ impl<'a> ArgMatches<'a> { match self.values_of_os("regexp") { None => { if self.values_of_os("file").is_none() { - if let Some(os_pat) = self.value_of_os("pattern") { + if let Some(os_pat) = self.value_of_os("PATTERN") { pats.push(try!(self.os_str_pattern(os_pat))); } } |