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

It might be better to output version and help to stdout #136

Open
lonnywong opened this issue Aug 18, 2024 · 2 comments
Open

It might be better to output version and help to stdout #136

lonnywong opened this issue Aug 18, 2024 · 2 comments

Comments

@lonnywong
Copy link
Member

Related to Homebrew/homebrew-core#181568.

@kke
Copy link

kke commented Aug 19, 2024

Yes.

Stdout = Information that user requested, interactive elements, payload
Stderr = Diagnostics, logging, errors, stuff you don't want to include when capturing/redirecting payload

Things like foo --help | less, foo --help | grep -i color and foo --version | grep -q v1.20. should work without redirecting stderr to stdout.

@lonnywong
Copy link
Member Author

The openssh client outputs version and help message to stderr.

/usr/bin/ssh 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr
/usr/bin/ssh -V 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr
/usr/bin/ssh -h 1>/tmp/ssh.stdout 2>/tmp/ssh.stderr

The output goes to /tmp/ssh.stderr, but not /tmp/ssh.stdout.

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

No branches or pull requests

2 participants