Exit code update, introduce leaks-exit-code flag (#481)

This commit is contained in:
Zachary Rice authored and GitHub committed 2020-12-08 17:41:02 -05:00
1 parent 65f42020af
commit 3909ebe03b
2 files changed
+5

No files matched your search

+4
View File
@@ -61,6 +61,10 @@ func main() {
log.Error(err)
os.Exit(1)
}
if len(scannerReport.Leaks) != 0 {
os.Exit(opts.CodeOnLeak)
}
}
func listenForInterrupt(stopScan chan os.Signal) {
+1
View File
@@ -37,6 +37,7 @@ type Options struct {
Redact bool `long:"redact" description:"Redact secrets from log messages and leaks"`
Debug bool `long:"debug" description:"Log debug messages"`
NoGit bool `long:"no-git" description:"Treat git repos as plain directories and scan those files"`
CodeOnLeak int `long:"leaks-exit-code" default:"1" description:"Exit code when leaks have been encountered"`
// Report Options
Report string `short:"o" long:"report" description:"Report output path"`