Skip to content

Commit

Permalink
Fix flags detection regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpirog committed Apr 8, 2022
1 parent 8310c95 commit 639f571
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion coloredcobra.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 639f571

Please sign in to comment.