-
-
Notifications
You must be signed in to change notification settings - Fork 22
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 CLI options to handle colouring #22
Comments
I'll have a go |
@chshersh I'm a bit confused by strings:
As I understand the former is about output and the latter about command line parsing, so they will probably coexist smoothly, but still feels a bit odd Is this deliberate? |
Since If you feel like it, you can create a separate issue to change types in |
Currently, Iris checks
stdout
andstderr
handles to decide whether they support colouring or not. And that's all. This issue is about improving the detection of colouring via CLI options.Description
Following CLI Guidelines, the new logic for detecting colouring should be as follows:
NO_COLOR
/NO_COLOUR
environment variable is set<MY_APP_NAME>_NO_COLOR
/<MY_APP_NAME>_NO_COLOUR
environment variable is setTERM
environment variable is set todumb
--no-color
/--no-colour
/--disable-color
/--disable-colour
options is provided--no-color
with the description. Other options shouldn't be displayed. Use internal for other options.Additionally, Iris should provide the
--color
option (with the--colour
option as well being hidden viainternal
) with the following values:auto
(default): detects colouring automatically by checking handles, environment variables and disabling CLI optionsnever
: disables colouringalways
: always prints colours; has higher priority than any other optionImplementation
Iris.Cli.Colour
always
/auto
/never
optionsIris.Colour.Detect
with the implementation of the colouring detection logic described in the beginning of this issuestdout
andstderr
. In other words, env variables and CLI disable / enable options apply to bothstdout
andstderr
. The only different part is whether the specific handle supports colouring or notThe text was updated successfully, but these errors were encountered: