mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
linting, more testing, cleaning
This commit is contained in:
1 parent
36c31bf181
commit
0ed0489c2d
6 files changed
+113
-72
No files matched your search
+4
-4
@@ -193,7 +193,7 @@ func (opts *Options) parseOptions(args []string) error {
|
||||
opts.LogLevel = opts.nextInt(args, &i)
|
||||
case "-h", "--help":
|
||||
help()
|
||||
os.Exit(EXIT_CLEAN)
|
||||
os.Exit(ExitClean)
|
||||
default:
|
||||
if match, value := opts.optString(arg, "--token="); match {
|
||||
opts.Token = value
|
||||
@@ -219,7 +219,7 @@ func (opts *Options) parseOptions(args []string) error {
|
||||
} else {
|
||||
fmt.Printf("Unknown option %s\n\n", arg)
|
||||
help()
|
||||
os.Exit(EXIT_CLEAN)
|
||||
os.Exit(ExitClean)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -242,7 +242,7 @@ func (opts *Options) parseOptions(args []string) error {
|
||||
|
||||
if _, err := os.Stat(dotGitPath); os.IsNotExist(err) {
|
||||
fmt.Printf("gitleaks has no target")
|
||||
os.Exit(EXIT_CLEAN)
|
||||
os.Exit(ExitClean)
|
||||
} else {
|
||||
opts.LocalMode = true
|
||||
opts.RepoPath = pwd
|
||||
@@ -258,7 +258,7 @@ func (opts *Options) parseOptions(args []string) error {
|
||||
func (opts *Options) failF(format string, args ...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, format, args...)
|
||||
help()
|
||||
os.Exit(EXIT_FAILURE)
|
||||
os.Exit(ExitFailure)
|
||||
}
|
||||
|
||||
// guards will prevent gitleaks from continuing if any invalid options
|
||||
|
||||
Reference in new issue
Block a user