-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send --help output to stdout #4884
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matklad (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks! Looks like some tests may be failing though? |
I don't understand how this could be caused by my patch. |
@bors try Looks like the failure was caused by a yanked docopt from the first of January 😆 |
Send --help output to stdout Fixes #4878
☀️ Test successful - status-appveyor, status-travis |
src/cargo/lib.rs
Outdated
@@ -142,7 +142,8 @@ pub fn exit_with_error(err: CliError, shell: &mut Shell) -> ! { | |||
} else if fatal { | |||
drop(shell.error(&error)) | |||
} else { | |||
drop(writeln!(shell.err(), "{}", error)) | |||
// Non-fatal messages, like --help output, go to stdout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this comment is a bit misleading: a ton of non-fatal messages, like Downloading foo...
purposefully use stderr. Maybe drop this comment or change it to "unlike all other human-readable output, help goes to stdout so as to make it easier to use pager with cargo --help".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I'll just drop it, I suppose anybody who is curious can read the history.
Oops sorry about that! Good catch! |
@bors: r+ |
📌 Commit 836e3ef has been approved by |
Send --help output to stdout Fixes #4878
☀️ Test successful - status-appveyor, status-travis |
Fixes #4878