| 23 | } |
| 24 | |
| 25 | func ParseOptions() (*Options, error) { |
| 26 | options := &Options{ |
| 27 | Threads: flag.Int("threads", 0, "Number of concurrent threads (default number of logical CPUs)"), |
| 28 | Silent: flag.Bool("silent", false, "Suppress all output except for errors"), |
| 29 | Debug: flag.Bool("debug", false, "Print debugging information"), |
| 30 | MaximumRepositorySize: flag.Uint("maximum-repository-size", 5120, "Maximum repository size to process in KB"), |
| 31 | MaximumFileSize: flag.Uint("maximum-file-size", 512, "Maximum file size to process in KB"), |
| 32 | CloneRepositoryTimeout: flag.Uint("clone-repository-timeout", 10, "Maximum time it should take to clone a repository in seconds. Increase this if you have a slower connection"), |
| 33 | EntropyThreshold: flag.Float64("entropy-threshold", 5.0, "Set to 0 to disable entropy checks"), |
| 34 | MinimumStars: flag.Uint("minimum-stars", 0, "Only process repositories with this many stars. Default 0 will ignore star count"), |
| 35 | PathChecks: flag.Bool("path-checks", true, "Set to false to disable checking of filepaths, i.e. just match regex patterns of file contents"), |
| 36 | ProcessGists: flag.Bool("process-gists", true, "Will watch and process Gists. Set to false to disable."), |
| 37 | TempDirectory: flag.String("temp-directory", filepath.Join(os.TempDir(), Name), "Directory to process and store repositories/matches"), |
| 38 | CsvPath: flag.String("csv-path", "", "CSV file path to log found secrets to. Leave blank to disable"), |
| 39 | SearchQuery: flag.String("search-query", "", "Specify a search string to ignore signatures and filter on files containing this string (regex compatible)"), |
| 40 | } |
| 41 | |
| 42 | flag.Parse() |
| 43 | |
| 44 | return options, nil |
| 45 | } |