mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
feat: check cargo uninstall package opt with empty value
This commit is contained in:
parent
c347745613
commit
cc6b43753b
@ -15,6 +15,14 @@ pub fn cli() -> App {
|
||||
|
||||
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
|
||||
let root = args.value_of("root");
|
||||
|
||||
if args.is_present_with_zero_values("package") {
|
||||
return Err(anyhow::anyhow!(
|
||||
"\"--package <SPEC>\" requires a SPEC format value.\n\
|
||||
Run `cargo help pkgid` for more information about SPEC format."
|
||||
).into())
|
||||
}
|
||||
|
||||
let specs = args
|
||||
.values_of("spec")
|
||||
.unwrap_or_else(|| args.values_of("package").unwrap_or_default())
|
||||
|
Loading…
x
Reference in New Issue
Block a user