Allow multiple xor:"" groups to be defined.

Fixes #113.
This commit is contained in:
Alec Thomas
2021-06-21 18:58:44 +09:30
parent 8aa52739ea
commit 54558f65e8
5 changed files with 32 additions and 14 deletions
+5 -6
View File
@@ -871,13 +871,12 @@ func checkXorDuplicates(paths []*Path) error {
if !flag.Set {
continue
}
if flag.Xor == "" {
continue
for _, xor := range flag.Xor {
if seen[xor] != nil {
return fmt.Errorf("--%s and --%s can't be used together", seen[xor].Name, flag.Name)
}
seen[xor] = flag
}
if seen[flag.Xor] != nil {
return fmt.Errorf("--%s and --%s can't be used together", seen[flag.Xor].Name, flag.Name)
}
seen[flag.Xor] = flag
}
}
return nil