From 639f5712655d523d73724245926c9e98ee4ff635 Mon Sep 17 00:00:00 2001 From: ivanpirog Date: Fri, 8 Apr 2022 12:20:16 +0300 Subject: [PATCH] Fix flags detection regexp --- coloredcobra.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coloredcobra.go b/coloredcobra.go index 5870688..f06625e 100644 --- a/coloredcobra.go +++ b/coloredcobra.go @@ -219,7 +219,7 @@ func Init(cfg *Config) { // Styling short and full flags (-f, --flag) if cf != nil { - re := regexp.MustCompile(`(--?\w+)`) + re := regexp.MustCompile(`(--?\S+)`) for _, flag := range re.FindAllString(lines[k], 2) { lines[k] = strings.Replace(lines[k], flag, cf.Sprint(flag), 1) }