Skip to content

Commit

Permalink
--vers arg now required for yank cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikastiv committed Sep 12, 2020
1 parent cb3f9f4 commit 51fa3a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/bin/cargo/commands/yank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ pub fn cli() -> App {
.about("Remove a pushed crate from the index")
.arg(opt("quiet", "No output printed to stdout").short("q"))
.arg(Arg::with_name("crate"))
.arg(opt("vers", "The version to yank or un-yank").value_name("VERSION"))
.arg(
opt("vers", "The version to yank or un-yank")
.value_name("VERSION")
.required(true),
)
.arg(opt(
"undo",
"Undo a yank, putting a version back into the index",
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ pub fn yank(
};
let version = match version {
Some(v) => v,
None => bail!("a version must be specified to yank (use --vers <VERSION>)"),
None => bail!("a version must be specified to yank"),
};

let (mut registry, _) = registry(config, token, index, reg, true, true)?;
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ Caused by:
"owner",
"publish",
"search",
"yank",
"yank --vers 0.0.1",
] {
p.cargo(cmd)
.arg("--registry")
Expand Down

0 comments on commit 51fa3a4

Please sign in to comment.