Skip to content

Commit 20340e1

Browse files
committed
Rename arg and adjust tests
1 parent d5538c3 commit 20340e1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/bin/cargo/commands/report.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ pub fn cli() -> App {
1919
)
2020
.value_name("id"),
2121
)
22-
.arg(
23-
opt("crate", "identifier of the crate to display a report for")
24-
.value_name("crate"),
25-
),
22+
.arg_package("Package to display a report for")
2623
)
2724
}
2825

@@ -42,7 +39,7 @@ fn report_future_incompatibilies(config: &Config, args: &ArgMatches<'_>) -> CliR
4239
let id = args
4340
.value_of_u32("id")?
4441
.unwrap_or_else(|| reports.last_id());
45-
let krate = args.value_of("crate");
42+
let krate = args.value_of("package");
4643
let report = reports.get_report(id, config, krate)?;
4744
drop_println!(config, "{}", REPORT_PREAMBLE);
4845
drop(config.shell().print_ansi_stdout(report.as_bytes()));

tests/testsuite/future_incompat_report.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ fn test_multi_crate() {
205205
// Check that we don't have the 'triggers' message shown at the bottom of this loop,
206206
// and that we don't explain how to show a per-package report
207207
.with_stderr_does_not_contain("[..]triggers[..]")
208-
.with_stderr_does_not_contain("[..]--crate[..]")
208+
.with_stderr_does_not_contain("[..]--package[..]")
209+
.with_stderr_does_not_contain("[..]-p[..]")
209210
.run();
210211

211212
p.cargo(command).arg("-Zunstable-options").arg("-Zfuture-incompat-report").arg("--future-incompat-report")
@@ -216,16 +217,18 @@ fn test_multi_crate() {
216217
.with_stderr_contains(" - second-dep v0.0.2")
217218
.run();
218219

219-
p.cargo("report future-incompatibilities").arg("--crate").arg("first-dep v0.0.1").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
220+
p.cargo("report future-incompatibilities").arg("--package").arg("first-dep v0.0.1").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
220221
.masquerade_as_nightly_cargo()
221222
.with_stdout_contains("The package `first-dep v0.0.1` currently triggers the following future incompatibility lints:")
222223
.with_stdout_contains(FUTURE_OUTPUT)
224+
.with_stdout_does_not_contain("[..]second-dep[..]")
223225
.run();
224226

225-
p.cargo("report future-incompatibilities").arg("--crate").arg("second-dep v0.0.2").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
227+
p.cargo("report future-incompatibilities").arg("--package").arg("second-dep v0.0.2").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
226228
.masquerade_as_nightly_cargo()
227229
.with_stdout_contains("The package `second-dep v0.0.2` currently triggers the following future incompatibility lints:")
228230
.with_stdout_contains(FUTURE_OUTPUT)
231+
.with_stdout_does_not_contain("[..]first-dep[..]")
229232
.run();
230233
}
231234

0 commit comments

Comments
 (0)