From: Kornel Date: Tue, 31 Oct 2017 17:45:57 +0000 (+0000) Subject: Alternative list display X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~5^2~5^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7aac2f9d16ccb386924cb4e77fd8523f4cbcf44a;p=cargo.git Alternative list display --- diff --git a/src/cargo/ops/cargo_run.rs b/src/cargo/ops/cargo_run.rs index 636a62646..c20d7bf16 100644 --- a/src/cargo/ops/cargo_run.rs +++ b/src/cargo/ops/cargo_run.rs @@ -17,7 +17,7 @@ pub fn run(ws: &Workspace, 0 => ws.current()?, 1 => ws.members() .find(|pkg| pkg.name() == xs[0]) - .ok_or_else(|| + .ok_or_else(|| CargoError::from( format!("package `{}` is not a member of the workspace", xs[0])) )?, @@ -46,7 +46,7 @@ pub fn run(ws: &Workspace, if !options.filter.is_specific() { bail!("`cargo run` requires that a project only have one \ executable; use the `--bin` option to specify which one \ - to run ({})", bins.join(", ")) + to run\navailable binaries: {}", bins.join(", ")) } else { bail!("`cargo run` can run at most one executable, but \ multiple were specified") diff --git a/tests/required-features.rs b/tests/required-features.rs index cdcc8d494..233f7f6f5 100644 --- a/tests/required-features.rs +++ b/tests/required-features.rs @@ -996,5 +996,5 @@ fn run_default_multiple_required_features() { assert_that(p.cargo("run"), execs().with_status(101).with_stderr("\ error: `cargo run` requires that a project only have one executable; \ -use the `--bin` option to specify which one to run (foo1, foo2)")); +use the `--bin` option to specify which one to run\navailable binaries: foo1, foo2")); } diff --git a/tests/run.rs b/tests/run.rs index 66e5350e4..efa107c4b 100644 --- a/tests/run.rs +++ b/tests/run.rs @@ -256,7 +256,7 @@ fn too_many_bins() { execs().with_status(101) .with_stderr("[ERROR] `cargo run` requires that a project only \ have one executable; use the `--bin` option \ - to specify which one to run ([..])\n")); + to specify which one to run\navailable binaries: [..]\n")); } #[test] @@ -278,7 +278,7 @@ fn too_many_bins_implicit() { execs().with_status(101) .with_stderr("[ERROR] `cargo run` requires that a project only \ have one executable; use the `--bin` option \ - to specify which one to run ([..])\n")); + to specify which one to run\navailable binaries: [..]\n")); } #[test]