Skip to content
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

Merged
merged 1 commit into from
Jan 3, 2018
Merged

Conversation

tromey
Copy link
Contributor

@tromey tromey commented Jan 1, 2018

Fixes #4878

@rust-highfive
Copy link

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.

@alexcrichton
Copy link
Member

Thanks! Looks like some tests may be failing though?

@tromey
Copy link
Contributor Author

tromey commented Jan 2, 2018

error[E0277]: the trait bound for<'de> Flags: serde::Deserialize<'de> is not satisfied

I don't understand how this could be caused by my patch.

@matklad
Copy link
Member

matklad commented Jan 2, 2018

@bors try

Looks like the failure was caused by a yanked docopt from the first of January 😆

@bors
Copy link
Contributor

bors commented Jan 2, 2018

⌛ Trying commit f4537b2 with merge 21ec7c6...

bors added a commit that referenced this pull request Jan 2, 2018
Send --help output to stdout

Fixes #4878
@bors
Copy link
Contributor

bors commented Jan 2, 2018

☀️ Test successful - status-appveyor, status-travis
State: approved= try=True

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.
Copy link
Member

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".

Copy link
Contributor Author

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.

@alexcrichton
Copy link
Member

Oops sorry about that! Good catch!

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jan 3, 2018

📌 Commit 836e3ef has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jan 3, 2018

⌛ Testing commit 836e3ef with merge d4e0b71...

bors added a commit that referenced this pull request Jan 3, 2018
@bors
Copy link
Contributor

bors commented Jan 3, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing d4e0b71 to master...

@bors bors merged commit 836e3ef into rust-lang:master Jan 3, 2018
@tromey tromey deleted the help-to-stdout branch January 4, 2018 03:36
@ehuss ehuss added this to the 1.25.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"cargo help test" output should go to stdout
6 participants