{"record":{"id":"b94f015abb0895e3","repo":"larksuite/cli","slug":"independent-alias-s-must-declare-a-supported-co","errorCode":null,"errorMessage":"independent alias --%s must declare a supported Conflict","messagePattern":"independent alias --(.+?) must declare a supported Conflict","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/common/typed_compile_args.go","lineNumber":369,"sourceCode":"\t\t}\n\t\tseenAliases[alias.Name] = struct{}{}\n\t\tswitch alias.Mode {\n\t\tcase typedAliasNormalize:\n\t\t\tif alias.Conflict != \"\" {\n\t\t\t\treturn fmt.Errorf(\"normalize alias --%s cannot declare Conflict\", alias.Name)\n\t\t\t}\n\t\t\tif alias.Deprecated {\n\t\t\t\treturn fmt.Errorf(\"deprecated alias --%s must use independent mode so Cobra can emit its warning\", alias.Name)\n\t\t\t}\n\t\tcase typedAliasIndependent:\n\t\t\tswitch alias.Conflict {\n\t\t\tcase typedAliasCanonicalWins, typedAliasErrorIfBoth:\n\t\t\tcase typedAliasTrimmedEqualOrError:\n\t\t\t\tif indirectKind(field.valueType) != reflect.String {\n\t\t\t\t\treturn fmt.Errorf(\"trimmed_equal_or_error alias --%s requires string input\", alias.Name)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"independent alias --%s must declare a supported Conflict\", alias.Name)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"alias --%s has invalid Mode %q\", alias.Name, alias.Mode)\n\t\t}\n\t}\n\treturn nil\n}\n\ntype schemaTag struct {\n\trequired     bool\n\toptional     bool\n\tnullable     *bool\n\tdefaultValue typedInputDefault\n\tenum         []string\n\tformat       string\n\tminLength    *int\n\tmaxLength    *int\n\tminimum      *float64","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/common/typed_compile_args.go#L351-L387","documentation":"Thrown by validateInputCLI when an independent-mode alias declares a Conflict value outside the supported set (canonical-wins, error-if-both, trimmed_equal_or_error). The compiler requires independent aliases to state an explicit, supported conflict policy because both flags can be supplied independently.","triggerScenarios":"A tag like `alias:--old;mode=independent;conflict=some-strategy` (unknown name), or mode=independent with no conflict at all; compileInput -> validateInputCLI hits the default branch of the Conflict switch.","commonSituations":"Typo in the conflict keyword (e.g. canoncial-wins); inventing a strategy name that exists in another framework; switching mode from normalize (which forbids Conflict) to independent without adding a valid Conflict.","solutions":["Set conflict to one of: canonical-wins, error-if-both, trimmed_equal_or_error","Fix spelling of the conflict keyword","If the alias should fold silently, use mode=normalize instead of independent"],"exampleFix":"// before\nName string `cli:\"--name,alias:--nom;mode=independent;conflict=first-wins\"`\n// after\nName string `cli:\"--name,alias:--nom;mode=independent;conflict=canonical-wins\"`","handlingStrategy":"validation","validationCode":"var validConflicts = map[string]bool{\"canonical-wins\": true, \"error-if-both\": true, \"trimmed_equal_or_error\": true}\nif a.Mode == \"independent\" && !validConflicts[a.Conflict] {\n    return fmt.Errorf(\"alias --%s: conflict %q not supported\", a.Name, a.Conflict)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a const list of supported conflict values and reference it in tags","Lint CLI tags for known keyword spellings","Always declare Conflict when using mode=independent"],"tags":["cli","flags","alias","validation"],"backgroundTag":"invalid-flag-alias-configuration","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}