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

Add option to print help to stderr #3289

Closed
wants to merge 1 commit into from

Conversation

TheOnlyMrCat
Copy link

Some command-line utilities reserve stdout for special purposes, for example, a cd frontend might use it to tell the shell where to cd to. The conflict arises when clap prints its help messages to stdout.

App::write_help can be used to write to an arbitrary stream, but it does not provide colour output.

This PR adds AppSettings::PrintToStderr to optionally print the help and version messages to stderr instead of stdout. This changes the behaviour of the automatic help and version printing, as well as the App::print_help and App::print_long_help methods.

Copy link
Member

@epage epage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This request is being discussed in #1788. In particular, see my last comment.

Once we have that resolved, we can move forward with this.

@epage
Copy link
Member

epage commented Sep 22, 2022

#1788 was rejected though #4248 might help

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.

None yet

2 participants