allow specifying package with -p

currently `cargo fmt -p blah` is rejected but `cargo fmt --package blah` is allowed. both should be allowed
This commit is contained in:
David Hewson 2019-01-01 17:49:55 +00:00
parent 996d5e8d6c
commit a8d2591f0c

View file

@ -56,7 +56,7 @@ fn execute() -> i32 {
let mut is_package_arg = false;
for arg in env::args().skip(2).take_while(|a| a != "--") {
if arg.starts_with('-') {
is_package_arg = arg.starts_with("--package");
is_package_arg = arg.starts_with("--package") | arg.starts_with("-p");
} else if !is_package_arg {
print_usage_to_stderr(&opts, &format!("Invalid argument: `{}`.", arg));
return FAILURE;