mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Quiet flag (#491)
* Adding a quiet option * better description Co-authored-by: Zach Rice <zrice@gitlab.com>
This commit is contained in:
1 parent
091ea81e68
commit
58d130c5f3
6 files changed
+39
-27
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user