Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up"-c never" and NO_COLOR are not respected for -h and other usage messages #600
Comments
|
Thank you for reporting this. That should be fixed, if possible (I'm not entirely sure if clap allows us to read the value of |
|
@sharkdp If you did not yet take a look, I'd like to try to debug and offer a PR |
sounds great! |
|
@tpiekarski It's probably not completely trivial. We might need to set But maybe I'm missing something. |
|
@sharkdp Thanks for taking a closer look. |
Indeed it does not look straight forward at all. But I got an idea how it could be accomplished without providing a custom function for In app.rs#L7 The only issue I did not yet figured out is, how it could be possible to check the argument color without being able to parse the arguments with |
That's why I suggested the approach above. We will not be able to set It might be worth asking this question in the |
|
Alright, I suspected that you checked such solution already. None the less I wanted to take a look into the issue. I am not so much in favor to rewrite Indeed there is an open issue at clap for the very feature we've been talking about Partial / Pre Parsing a CLI. What do you think we track this issue and return to this here when it is possible to pre-parsing arguments? To be frank I'm not confident to look into the issue at clap myself - I am not experienced enough with Rust. Maybe you've got the time to take a closer look there. |
|
I guess we could at least implement the |
|
this is how we do it in |
When adding
-c neverI would expect it to also apply to the-houtput, but that's still coloured:This also applies to something like
fd -c none -v, which is an error but has coloured (hard to read) output:In general, I'd really recommend to be careful with coloured terminal stuff, because what's helpful for one personal might be next-to-unreadable for the next (especially if it's non-configurable).
This is fd 8.1.0 on Void Linux.