updated readme, better logging

This commit is contained in:
zricethezav committed 2018-02-25 16:10:44 -06:00
1 parent c104ff9157
commit 1cecd5e090
7 files changed
+133 -90

No files matched your search

+13 -12
View File
@@ -9,15 +9,17 @@ import (
const usage = `usage: gitleaks [options] <url>
Options:
-c --concurrency Concurrency factor (default is 10)
-u --user Git user url
-r --repo Git repo url
-o --org Git organization url
-c --concurrency Upper bound on concurrent diffs
-u --user Git user url
-r --repo Git repo url
-o --org Git organization url
-s --since Commit to stop at
-b --b64Entropy Base64 entropy cutoff (default is 70)
-x --hexEntropy Hex entropy cutoff (default is 40)
-e --entropy Enable entropy
-j --json Output gitleaks report
-h --help Display this message
--token Github API token
--strict Enables stopwords
`
@@ -37,7 +39,7 @@ type Options struct {
Tmp bool
EnableJSON bool
Token string
Verbose bool
Verbose bool
}
// help prints the usage string and exits
@@ -103,20 +105,14 @@ func parseOptions(args []string) *Options {
opts.OrgURL = optionsNextString(args, &i)
case "-u", "--user":
opts.UserURL = optionsNextString(args, &i)
case "-p", "--persist":
opts.UserURL = optionsNextString(args, &i)
case "-r", "--repo":
opts.RepoURL = optionsNextString(args, &i)
case "-f", "--forks":
opts.IncludeForks = true
case "-t", "--temporary":
opts.Tmp = true
case "-gt", "--token":
case "--token":
opts.Token = optionsNextString(args, &i)
case "-j", "--json":
opts.EnableJSON = true
case "-v", "--verbose":
opts.Verbose = true
case "-h", "--help":
help()
return nil
@@ -131,5 +127,10 @@ func parseOptions(args []string) *Options {
}
}
// "guards"
if opts.Tmp && opts.EnableJSON {
fmt.Println("Report generation with temporary clones not supported")
}
return opts
}