mirror of
https://github.com/rust-lang/cargo
synced 2024-10-14 19:52:45 +00:00
Auto merge of #4884 - tromey:help-to-stdout, r=alexcrichton
Send --help output to stdout Fixes #4878
This commit is contained in:
commit
d4e0b71c05
|
@ -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 {
|
||||
|
|
|
@ -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 [..]"));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue