diff --git a/src/cargo/lib.rs b/src/cargo/lib.rs index d68d8864a90..6e8d771541c 100755 --- a/src/cargo/lib.rs +++ b/src/cargo/lib.rs @@ -142,7 +142,7 @@ pub fn exit_with_error(err: CliError, shell: &mut Shell) -> ! { } else if fatal { drop(shell.error(&error)) } else { - drop(writeln!(shell.err(), "{}", error)) + println!("{}", error); } if !handle_cause(&error, shell) || hide { diff --git a/tests/search.rs b/tests/search.rs index 9410ce7e72d..028f7f52b70 100644 --- a/tests/search.rs +++ b/tests/search.rs @@ -277,4 +277,9 @@ fn help() { execs().with_status(0)); assert_that(cargo_process("help").arg("search"), execs().with_status(0)); + // Ensure that help output goes to stdout, not stderr. + assert_that(cargo_process("search").arg("--help"), + execs().with_stderr("")); + assert_that(cargo_process("search").arg("--help"), + execs().with_stdout_contains("[..] --frozen [..]")); }