]> git.proxmox.com Git - cargo.git/commitdiff
Rename arg and adjust tests
authorAaron Hill <aa1ronham@gmail.com>
Tue, 5 Oct 2021 00:20:23 +0000 (19:20 -0500)
committerAaron Hill <aa1ronham@gmail.com>
Tue, 12 Oct 2021 21:35:01 +0000 (16:35 -0500)
src/bin/cargo/commands/report.rs
tests/testsuite/future_incompat_report.rs

index a55641a4d620a6f8e8d74f9d93cdf30133e28bbc..c4010d4e472c0e11d05f1009436d042c108da713 100644 (file)
@@ -19,10 +19,7 @@ pub fn cli() -> App {
                     )
                     .value_name("id"),
                 )
-                .arg(
-                    opt("crate", "identifier of the crate to display a report for")
-                        .value_name("crate"),
-                ),
+                .arg_package("Package to display a report for")
         )
 }
 
@@ -42,7 +39,7 @@ fn report_future_incompatibilies(config: &Config, args: &ArgMatches<'_>) -> CliR
     let id = args
         .value_of_u32("id")?
         .unwrap_or_else(|| reports.last_id());
-    let krate = args.value_of("crate");
+    let krate = args.value_of("package");
     let report = reports.get_report(id, config, krate)?;
     drop_println!(config, "{}", REPORT_PREAMBLE);
     drop(config.shell().print_ansi_stdout(report.as_bytes()));
index 69a8e5511a2ba07591ac8037a9dc3dd89862071c..f6bec72c4c547de548b1c949763516187cfa47c9 100644 (file)
@@ -205,7 +205,8 @@ fn test_multi_crate() {
             // Check that we don't have the 'triggers' message shown at the bottom of this loop,
             // and that we don't explain how to show a per-package report
             .with_stderr_does_not_contain("[..]triggers[..]")
-            .with_stderr_does_not_contain("[..]--crate[..]")
+            .with_stderr_does_not_contain("[..]--package[..]")
+            .with_stderr_does_not_contain("[..]-p[..]")
             .run();
 
         p.cargo(command).arg("-Zunstable-options").arg("-Zfuture-incompat-report").arg("--future-incompat-report")
@@ -216,16 +217,18 @@ fn test_multi_crate() {
             .with_stderr_contains("  - second-dep v0.0.2")
             .run();
 
-        p.cargo("report future-incompatibilities").arg("--crate").arg("first-dep v0.0.1").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
+        p.cargo("report future-incompatibilities").arg("--package").arg("first-dep v0.0.1").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
             .masquerade_as_nightly_cargo()
             .with_stdout_contains("The package `first-dep v0.0.1` currently triggers the following future incompatibility lints:")
             .with_stdout_contains(FUTURE_OUTPUT)
+            .with_stdout_does_not_contain("[..]second-dep[..]")
             .run();
 
-        p.cargo("report future-incompatibilities").arg("--crate").arg("second-dep v0.0.2").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
+        p.cargo("report future-incompatibilities").arg("--package").arg("second-dep v0.0.2").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
             .masquerade_as_nightly_cargo()
             .with_stdout_contains("The package `second-dep v0.0.2` currently triggers the following future incompatibility lints:")
             .with_stdout_contains(FUTURE_OUTPUT)
+            .with_stdout_does_not_contain("[..]first-dep[..]")
             .run();
     }