Alternative list display
authorKornel <kornel@geekhood.net>
Tue, 31 Oct 2017 17:45:57 +0000 (17:45 +0000)
committerKornel <kornel@geekhood.net>
Tue, 31 Oct 2017 19:44:56 +0000 (19:44 +0000)
src/cargo/ops/cargo_run.rs
tests/required-features.rs
tests/run.rs

index 636a626463e26cf940f3f0c4b06ded9442aba0d6..c20d7bf165f83238cf68da6d3bab175b758cb294 100644 (file)
@@ -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")
index cdcc8d494c7d9aa8061b1c02eedfc94cdacdf263..233f7f6f501c26ab1cf7503e09e6a782aa28d8fc 100644 (file)
@@ -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"));
 }
index 66e5350e435980fe8b47142f154da880b14e05b2..efa107c4b91b046fa7311d6e1a3606edfffa3929 100644 (file)
@@ -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]