From: Tom Tromey Date: Mon, 1 Jan 2018 22:33:01 +0000 (-0700) Subject: Send --help output to stdout X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~3^2~63^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=836e3efd38c0602202f756fe8f55096064849a2b;p=cargo.git Send --help output to stdout Fixes #4878 --- diff --git a/src/cargo/lib.rs b/src/cargo/lib.rs index d68d8864a..6e8d77154 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 9410ce7e7..028f7f52b 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 [..]")); }