Add deduplicate flag

This commit is contained in:
2025-03-29 17:25:23 +01:00
parent fe6e97e832
commit 14d64495b6
2 changed files with 6 additions and 3 deletions

View File

@@ -156,9 +156,11 @@ func ProcessRegex(content string, command utils.ModifyCommand, filename string)
}
}
// TODO: Make this optional through modifier flags
// Sometimes we want to keep capture groups as is, sometimes we know what we're doing
// captureGroups = deduplicateGroups(captureGroups)
// Use the DeduplicateGroups flag to control whether to deduplicate capture groups
if !command.NoDedup {
logger.Debug("Deduplicating capture groups as specified in command settings")
captureGroups = deduplicateGroups(captureGroups)
}
if err := toLua(L, captureGroups); err != nil {
logger.Error("Failed to set Lua variables: %v", err)