-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
Support colorless help #668
Conversation
e1b8215
to
d1c0e4f
Compare
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.
Thank you very much for your contribution!
src/app.rs
Outdated
@@ -1,10 +1,17 @@ | |||
use clap::{crate_version, App, AppSettings, Arg}; | |||
|
|||
pub fn build_app() -> App<'static, 'static> { | |||
let clap_color_setting = | |||
if atty::is(atty::Stream::Stdout) && std::env::var_os("NO_COLOR").is_none() { |
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 think clap
does an isatty
check internally, because fd --help | cat
is not colored at the moment. So I guess we could remove the atty::is(…)
part here (as well as the build dependency)
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.
isatty check removed (and rebased).
d1c0e4f
to
7a32e33
Compare
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.
Thank you for the update.
Could you please add a CHANGELOG entry (see CONTRIBUTING.md
section that I just added).
Nevermind, I will add it. |
Closes: #600