{"record":{"id":"a0d62321fbda7410","repo":"multica-ai/multica","slug":"s-s-and-s-are-mutually-exclusive","errorCode":null,"errorMessage":"--%s, --%s, and --%s are mutually exclusive","messagePattern":"--(.+?), --(.+?), and --(.+?) are mutually exclusive","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_issue.go","lineNumber":58,"sourceCode":"func resolveTextFlag(cmd *cobra.Command, flagName string) (string, bool, error) {\n\tstdinFlag := flagName + \"-stdin\"\n\tfileFlag := flagName + \"-file\"\n\tuseStdin, _ := cmd.Flags().GetBool(stdinFlag)\n\tinline, _ := cmd.Flags().GetString(flagName)\n\tfilePath, _ := cmd.Flags().GetString(fileFlag)\n\n\tsources := 0\n\tif useStdin {\n\t\tsources++\n\t}\n\tif inline != \"\" {\n\t\tsources++\n\t}\n\tif filePath != \"\" {\n\t\tsources++\n\t}\n\tif sources > 1 {\n\t\treturn \"\", false, fmt.Errorf(\"--%s, --%s, and --%s are mutually exclusive\", flagName, stdinFlag, fileFlag)\n\t}\n\n\tif useStdin {\n\t\tdata, err := io.ReadAll(os.Stdin)\n\t\tif err != nil {\n\t\t\treturn \"\", false, fmt.Errorf(\"read stdin for --%s: %w\", stdinFlag, err)\n\t\t}\n\t\tbody := strings.TrimSuffix(string(data), \"\\n\")\n\t\tif body == \"\" {\n\t\t\treturn \"\", false, fmt.Errorf(\"stdin content for --%s is empty\", stdinFlag)\n\t\t}\n\t\treturn body, true, nil\n\t}\n\tif filePath != \"\" {\n\t\tif err := ensureFileFlagWithinWorkdir(cmd, fileFlag, flagName, filePath); err != nil {\n\t\t\treturn \"\", false, err\n\t\t}\n\t\tdata, err := os.ReadFile(filePath)","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_issue.go#L40-L76","documentation":"Returned by the shared text-source helper (used by issue body/description flags) when more than one of the three input sources is set: an inline --flag value, its --flag-stdin variant, and its --flag-file variant. The helper counts set sources and rejects combinations so input provenance is unambiguous.","triggerScenarios":"Invoking an issue command with, e.g., both --description \"text\" and --description-file body.txt, or --label-stdin plus an inline --label value — any two or three of the mutually exclusive trio set simultaneously.","commonSituations":"Copy-pasted command lines accumulated flags over time; shell scripts that always pass defaults plus user overrides; wrappers that forward both a stdin pipe and a file argument on the same invocation.","solutions":["Keep exactly one source per value: inline flag, stdin variant, or file variant — remove the extras","For scripts, default the flags to empty strings and set only one conditionally","Check the command line with multica <cmd> --help to confirm which three flags the message names (flagName, stdinFlag, fileFlag are interpolated)"],"exampleFix":"# before\nmultica issue create --title \"Fix\" --description \"inline\" --description-file body.txt\n# error: --description, --description-stdin, and --description-file are mutually exclusive\n\n# after\nmultica issue create --title \"Fix\" --description-file body.txt","handlingStrategy":"validation","validationCode":"// count sources exactly like the CLI does\nsources := 0\nif inline != \"\" { sources++ }\nif useStdin { sources++ }\nif filePath != \"\" { sources++ }\nif sources > 1 {\n    return fmt.Errorf(\"pick one of --%s, --%s, --%s\", flagName, stdinFlag, fileFlag)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build command lines programmatically and assert at most one source per value","Avoid copy-paste accumulation of flags; start each command from a clean template"],"tags":["cli","flags","validation","mutual-exclusion"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}