CLI: Reject invalid argument values rather than ignore them (#6723)

* CLI: Reject invalid argument values rather than ignore them

* Fix grumbles
This commit is contained in:
Axel Chalon
2017-10-13 12:20:57 +02:00
committed by Arkadiy Paronyan
parent ba6594e30a
commit d77dabadbb
2 changed files with 43 additions and 19 deletions

View File

@@ -1203,6 +1203,16 @@ mod tests {
use toml;
use clap::{ErrorKind as ClapErrorKind};
#[test]
fn should_reject_invalid_values() {
let args = Args::parse(&["parity", "--cache=20"]);
assert!(args.is_ok());
let args = Args::parse(&["parity", "--cache=asd"]);
assert!(args.is_err());
}
#[test]
fn should_parse_args_and_flags() {
let args = Args::parse(&["parity", "--no-warp"]).unwrap();