Quiet flag (#491)

* Adding a quiet option

* better description

Co-authored-by: Zach Rice <zrice@gitlab.com>
This commit is contained in:
Zachary RiceandZach Rice authored and GitHub committed 2020-12-11 09:56:09 -05:00
1 parent 091ea81e68
commit 58d130c5f3
6 files changed
+39 -27

No files matched your search

+4
View File
@@ -21,6 +21,7 @@ import (
// Options stores values of command line options
type Options struct {
Verbose bool `short:"v" long:"verbose" description:"Show verbose output from scan"`
Quiet bool `short:"q" long:"quiet" description:"Sets log level to error and only output leaks, one json object per line"`
RepoURL string `short:"r" long:"repo-url" description:"Repository URL"`
Path string `short:"p" long:"path" description:"Path to directory (repo if contains .git) or file"`
ConfigPath string `short:"c" long:"config-path" description:"Path to config"`
@@ -83,6 +84,9 @@ func ParseOptions() (Options, error) {
if opts.Debug {
log.SetLevel(log.DebugLevel)
}
if opts.Quiet {
log.SetLevel(log.ErrorLevel)
}
return opts, nil
}