Add deduplicate flag
This commit is contained in:
@@ -156,9 +156,11 @@ func ProcessRegex(content string, command utils.ModifyCommand, filename string)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Make this optional through modifier flags
|
// Use the DeduplicateGroups flag to control whether to deduplicate capture groups
|
||||||
// Sometimes we want to keep capture groups as is, sometimes we know what we're doing
|
if !command.NoDedup {
|
||||||
// captureGroups = deduplicateGroups(captureGroups)
|
logger.Debug("Deduplicating capture groups as specified in command settings")
|
||||||
|
captureGroups = deduplicateGroups(captureGroups)
|
||||||
|
}
|
||||||
|
|
||||||
if err := toLua(L, captureGroups); err != nil {
|
if err := toLua(L, captureGroups); err != nil {
|
||||||
logger.Error("Failed to set Lua variables: %v", err)
|
logger.Error("Failed to set Lua variables: %v", err)
|
||||||
|
@@ -19,6 +19,7 @@ type ModifyCommand struct {
|
|||||||
Reset bool `yaml:"reset"`
|
Reset bool `yaml:"reset"`
|
||||||
LogLevel string `yaml:"loglevel"`
|
LogLevel string `yaml:"loglevel"`
|
||||||
Isolate bool `yaml:"isolate"`
|
Isolate bool `yaml:"isolate"`
|
||||||
|
NoDedup bool `yaml:"nodedup"`
|
||||||
}
|
}
|
||||||
type CookFile []ModifyCommand
|
type CookFile []ModifyCommand
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user