Skip to content

Commit

Permalink
Merge pull request #105 from coreos/crtrb_forcecolor
Browse files Browse the repository at this point in the history
contrib: Add a ability to force colored output in analyze-local-images
  • Loading branch information
Quentin-M committed Mar 17, 2016
2 parents e4749f4 + 251df95 commit 093107c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contrib/analyze-local-images/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var (
endpoint = flag.String("endpoint", "http://127.0.0.1:6060", "Address to Clair API")
myAddress = flag.String("my-address", "127.0.0.1", "Address from the point of view of Clair")
minimumSeverity = flag.String("minimum-severity", "Negligible", "Minimum severity of vulnerabilities to show (Unknown, Negligible, Low, Medium, High, Critical, Defcon1)")
flagNoColor = flag.Bool("no-color", false, "Disable color output")
colorMode = flag.String("color", "auto", "Colorize the output (always, auto, never)")
)

type vulnerabilityInfo struct {
Expand Down Expand Up @@ -104,8 +104,10 @@ func main() {
os.Exit(1)
}

if *flagNoColor {
if *colorMode == "never" {
color.NoColor = true
} else if *colorMode == "always" {
color.NoColor = false
}

// Save image.
Expand Down

0 comments on commit 093107c

Please sign in to comment.