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:
parent
996d5e8d6c
commit
a8d2591f0c
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue