From e6cb20bc83f0ba2d316d688129e07f91be474f49 Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Wed, 26 Apr 2023 13:50:21 -0400 Subject: [PATCH] fix: verbosity flag mishandled, causes panic on valid flag --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 6f01b57..3227781 100644 --- a/main.go +++ b/main.go @@ -138,11 +138,12 @@ func parseArgs(args []string) Config { verbosity := 0 depth := 9999 + verbosityMatchIndex := rVerboseFlag.SubexpIndex("verbosity") for _, arg := range os.Args { - verbosity_match := rVerboseFlag.FindAllString(arg, -1) + verbosity_match := rVerboseFlag.FindAllStringSubmatch(arg, -1) if verbosity_match != nil { - verbosity = len(verbosity_match[0]) + verbosity = len(verbosity_match[0][verbosityMatchIndex]) continue }