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

Allow color.NoColor = false to set via cli #1566

Closed
amandel opened this issue Jan 11, 2022 · 4 comments
Closed

Allow color.NoColor = false to set via cli #1566

amandel opened this issue Jan 11, 2022 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed.

Comments

@amandel
Copy link

amandel commented Jan 11, 2022

Reading https://github.com/fatih/color#github-actions it is possible to get colorful output also in ci environments by setting color.NoColor = false it would be nice if this can be set or forced via trivy cli option (like --no-colour=false) for the table output.

@amandel amandel added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 11, 2022
@stefanlasiewski
Copy link

Also see this related issue (Autoclosed):

#1091

@amandel
Copy link
Author

amandel commented Jan 13, 2022

Bringing #1091 and this one together as feature request:

The used color package does a good job in auto detecting whether the output supports ANSI coloring or not. Unfortunately for some use cases (mostly CI or other automation) this fails and needs manual override. Fortunately the color package already has this needed functionality as described in the color readme section for github-actions

For the table format of trivy, it would be nice to have a trivy cli option --color with possible values true, false, and default auto. The default is current behavior, true or false set color.NoColor to the respective value.

@stefanlasiewski
Copy link

This would be very useful for simple use cases like a simple shell script that calls trivy image ubuntu:20.04 | grep CVE.

--format json is more complicated then what many folks need, and --format template even more so.

@github-actions
Copy link

This issue is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

2 participants