fix: verbosity flag mishandled, causes panic on valid flag

This commit is contained in:
Marc 2023-04-26 13:50:21 -04:00
parent dd53df2a14
commit e6cb20bc83
Signed by: marc
GPG key ID: 048E042F22B5DC79

View file

@ -138,11 +138,12 @@ func parseArgs(args []string) Config {
verbosity := 0 verbosity := 0
depth := 9999 depth := 9999
verbosityMatchIndex := rVerboseFlag.SubexpIndex("verbosity")
for _, arg := range os.Args { for _, arg := range os.Args {
verbosity_match := rVerboseFlag.FindAllString(arg, -1) verbosity_match := rVerboseFlag.FindAllStringSubmatch(arg, -1)
if verbosity_match != nil { if verbosity_match != nil {
verbosity = len(verbosity_match[0]) verbosity = len(verbosity_match[0][verbosityMatchIndex])
continue continue
} }