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 coloring config argument #458

Merged
merged 1 commit into from
Jun 7, 2024
Merged

Add coloring config argument #458

merged 1 commit into from
Jun 7, 2024

Conversation

T1mVo
Copy link
Contributor

@T1mVo T1mVo commented Jun 6, 2024

Adds a --color=never/always/auto argument.

  • never: Never colorize the output.
  • always: Always colorize the output.
  • auto: Let colored decide whether to colorize the output. This depends on environment variables and checks if stdout is a terminal.

Resolves #428.

Adds a `--color=never/always/auto` argument.

- never: Never colorize the output.
- always: Always colorize the output.
- auto: Let colored decide whether to colorize the output.
  This depends on environment variables and checks if stdout is a terminal.
Comment on lines +178 to +183
match self.config.color {
ColorMode::Never => SHOULD_COLORIZE.set_override(false),
ColorMode::Always => SHOULD_COLORIZE.set_override(true),
ColorMode::Auto => (), // Let colored itself decide whether coloring should occur or not
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this an appropriate place to override the global colored settings?

Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Thank you!

@sharkdp sharkdp merged commit 0e098cd into sharkdp:master Jun 7, 2024
15 checks passed
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.

Feature request: Option to disable color
2 participants