{"record":{"id":"c0bcd791d22011e9","repo":"gastownhall/beads","slug":"cannot-use-multiple-conflict-resolution-flags","errorCode":null,"errorMessage":"cannot use multiple conflict resolution flags","messagePattern":"cannot use multiple conflict resolution flags","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/ado.go","lineNumber":127,"sourceCode":"\t// ADOConflictPreferADO always uses the Azure DevOps version.\n\tADOConflictPreferADO ADOConflictStrategy = \"prefer-ado\"\n)\n\n// getADOConflictStrategy determines the conflict strategy from flag values.\n// Returns error if multiple conflicting flags are set.\nfunc getADOConflictStrategy(preferLocal, preferADO, preferNewer bool) (ADOConflictStrategy, error) {\n\tflagsSet := 0\n\tif preferLocal {\n\t\tflagsSet++\n\t}\n\tif preferADO {\n\t\tflagsSet++\n\t}\n\tif preferNewer {\n\t\tflagsSet++\n\t}\n\tif flagsSet > 1 {\n\t\treturn \"\", fmt.Errorf(\"cannot use multiple conflict resolution flags\")\n\t}\n\n\tif preferLocal {\n\t\treturn ADOConflictPreferLocal, nil\n\t}\n\tif preferADO {\n\t\treturn ADOConflictPreferADO, nil\n\t}\n\treturn ADOConflictPreferNewer, nil\n}\n\nfunc init() {\n\t// Add subcommands to ado\n\tadoCmd.AddCommand(adoSyncCmd)\n\tadoCmd.AddCommand(adoStatusCmd)\n\tadoCmd.AddCommand(adoProjectsCmd)\n\n\t// Add flags to sync command","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/ado.go#L109-L145","documentation":"ADO sync conflict resolution accepts at most one strategy flag (--prefer-local, --prefer-ado, --prefer-newer, etc.). getADOConflictStrategy counts how many were set and refuses with this error when more than one is supplied, because a single unambiguous strategy must be chosen.","triggerScenarios":"Invoking an `bd ado sync`-family command with two or more mutually exclusive conflict-resolution flags set simultaneously (e.g. --prefer-local --prefer-newer).","commonSituations":"Copy-pasting command examples that each use a different flag; scripted wrappers accumulating flags across versions; aliases appending a default strategy on top of a user-supplied one.","solutions":["Pass exactly one conflict-resolution flag and rerun the command","Remove the redundant flag from your alias/script wrapper","Omit all strategy flags to use the default conflict behavior"],"exampleFix":"// before\nbd ado sync --prefer-local --prefer-newer\n// after\nbd ado sync --prefer-newer","handlingStrategy":"validation","validationCode":"flags := 0\nfor _, f := range []bool{preferLocal, preferADO, preferNewer} {\n    if f { flags++ }\n}\nif flags > 1 { return errors.New(\"pass at most one conflict resolution flag\") }","typeGuard":null,"tryCatchPattern":"if err := runADOSync(cmd, args); err != nil && strings.Contains(err.Error(), \"multiple conflict resolution flags\") {\n    cmd.Usage()\n    return err\n}","preventionTips":["Pass exactly one --prefer-* flag","Audit shell aliases that append default strategy flags","Omit flags to accept the default strategy"],"tags":["cli","azure-devops","flag-validation","conflict-resolution"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}