Auto merge of #4884 - tromey:help-to-stdout, r=alexcrichton

Send --help output to stdout

Fixes #4878
This commit is contained in:
bors 2018-01-03 22:38:53 +00:00
commit d4e0b71c05
2 changed files with 6 additions and 1 deletions

View file

@ -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 {

View file

@ -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 [..]"));
}