Skip to content

Commit 51fa3a4

Browse files
author
Mikastiv
committed
--vers arg now required for yank cmd
1 parent cb3f9f4 commit 51fa3a4

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/bin/cargo/commands/yank.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ pub fn cli() -> App {
77
.about("Remove a pushed crate from the index")
88
.arg(opt("quiet", "No output printed to stdout").short("q"))
99
.arg(Arg::with_name("crate"))
10-
.arg(opt("vers", "The version to yank or un-yank").value_name("VERSION"))
10+
.arg(
11+
opt("vers", "The version to yank or un-yank")
12+
.value_name("VERSION")
13+
.required(true),
14+
)
1115
.arg(opt(
1216
"undo",
1317
"Undo a yank, putting a version back into the index",

src/cargo/ops/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ pub fn yank(
801801
};
802802
let version = match version {
803803
Some(v) => v,
804-
None => bail!("a version must be specified to yank (use --vers <VERSION>)"),
804+
None => bail!("a version must be specified to yank"),
805805
};
806806

807807
let (mut registry, _) = registry(config, token, index, reg, true, true)?;

tests/testsuite/alt_registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ Caused by:
637637
"owner",
638638
"publish",
639639
"search",
640-
"yank",
640+
"yank --vers 0.0.1",
641641
] {
642642
p.cargo(cmd)
643643
.arg("--registry")

0 commit comments

Comments
 (0)