linting, more testing, cleaning

This commit is contained in:
zricethezav committed 2018-03-02 16:55:02 -06:00
1 parent 36c31bf181
commit 0ed0489c2d
6 files changed
+113 -72

No files matched your search

+4 -4
View File
@@ -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