mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
--since sh-sh-sha
This commit is contained in:
1 parent
2186f22999
commit
7a0ce07f99
2 files changed
+28
-19
No files matched your search
+18
-11
@@ -9,15 +9,16 @@ import (
|
||||
const usage = `usage: gitleaks [options] <url>
|
||||
|
||||
Options:
|
||||
-c Concurrency factor (default is 10)
|
||||
-u --user Git user url
|
||||
-r --repo Git repo url
|
||||
-o --org Git organization url
|
||||
-s --strict Strict mode uses stopwords in config.yml
|
||||
-b --b64Entropy Base64 entropy cutoff (default is 70)
|
||||
-x --hexEntropy Hex entropy cutoff (default is 40)
|
||||
-e --entropy Enable entropy
|
||||
-h --help Display this message
|
||||
-c Concurrency factor (default is 10)
|
||||
-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
|
||||
-h --help Display this message
|
||||
--strict Enables stopwords
|
||||
`
|
||||
|
||||
// Options for gitleaks
|
||||
@@ -30,6 +31,7 @@ type Options struct {
|
||||
RepoURL string
|
||||
Strict bool
|
||||
Entropy bool
|
||||
SinceCommit string
|
||||
}
|
||||
|
||||
// help prints the usage string and exits
|
||||
@@ -73,10 +75,16 @@ func parseOptions(args []string) *Options {
|
||||
Entropy: false,
|
||||
}
|
||||
|
||||
if len(args) == 0 {
|
||||
help()
|
||||
}
|
||||
|
||||
for i := 0; i < len(args); i++ {
|
||||
arg := args[i]
|
||||
switch arg {
|
||||
case "-s", "--strict":
|
||||
case "-s", "--since":
|
||||
opts.SinceCommit = optionsNextString(args, &i)
|
||||
case "--strict":
|
||||
opts.Strict = true
|
||||
case "-b", "--b64Entropy":
|
||||
opts.B64EntropyCutoff = optionsNextInt(args, &i)
|
||||
@@ -102,7 +110,6 @@ func parseOptions(args []string) *Options {
|
||||
} else {
|
||||
fmt.Printf("Uknown option %s\n\n", arg)
|
||||
help()
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user