{"record":{"id":"6b227bba6d0af3ff","repo":"larksuite/cli","slug":"s-alias-for-s-w","errorCode":null,"errorMessage":"%s alias for --%s: %w","messagePattern":"(.+?) alias for --(.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/flagalias/flagalias.go","lineNumber":93,"sourceCode":"\tcanonicalFlags := make(map[string]*pflag.Flag)\n\tseenCanonical := make(map[string]struct{})\n\tfor _, spec := range specs {\n\t\tif len(spec.Aliases) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcanonicalFlag := flagSet.Lookup(spec.Canonical)\n\t\tif canonicalFlag == nil {\n\t\t\treturn fmt.Errorf(\"%s declares aliases for unregistered flag --%s\", cmd.CommandPath(), spec.Canonical)\n\t\t}\n\t\tcanonical := canonicalFlag.Name\n\t\tif _, exists := seenCanonical[canonical]; exists {\n\t\t\treturn fmt.Errorf(\"%s declares flag aliases for --%s more than once after normalization\", cmd.CommandPath(), canonical)\n\t\t}\n\t\tseenCanonical[canonical] = struct{}{}\n\t\tcanonicalFlags[canonical] = canonicalFlag\n\t\tfor _, alias := range spec.Aliases {\n\t\t\tif err := validateAliasName(alias); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%s alias for --%s: %w\", cmd.CommandPath(), canonical, err)\n\t\t\t}\n\t\t\tnormalized := normalize(alias)\n\t\t\tif normalized == \"\" {\n\t\t\t\treturn fmt.Errorf(\"%s alias --%s for --%s normalizes to an empty name\", cmd.CommandPath(), alias, canonical)\n\t\t\t}\n\t\t\tif normalized == canonical {\n\t\t\t\treturn fmt.Errorf(\"%s declares --%s as an alias of itself (--%s after normalization)\", cmd.CommandPath(), alias, canonical)\n\t\t\t}\n\t\t\tif existing, ok := registered[normalized]; ok {\n\t\t\t\treturn fmt.Errorf(\"%s alias --%s for --%s conflicts with registered flag --%s after normalization\", cmd.CommandPath(), alias, canonical, existing)\n\t\t\t}\n\t\t\tif existing, ok := acceptedAliases[normalized]; ok {\n\t\t\t\treturn fmt.Errorf(\"%s alias --%s for --%s conflicts with existing alias for --%s after normalization to --%s\", cmd.CommandPath(), alias, canonical, existing, normalized)\n\t\t\t}\n\t\t\tif existing, ok := aliases[normalized]; ok {\n\t\t\t\tif existing == canonical {\n\t\t\t\t\treturn fmt.Errorf(\"%s declares duplicate alias --%s for --%s after normalization to --%s\", cmd.CommandPath(), alias, canonical, normalized)\n\t\t\t\t}","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/flagalias/flagalias.go#L75-L111","documentation":"Wraps validateAliasName failures during Bind: an individual alias name in a spec is malformed (invalid alias syntax). The wrapper prefixes the command path and canonical flag so the offending spec is identifiable.","triggerScenarios":"Thrown at internal/flagalias/flagalias.go:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the alias spelling to be a valid flag name (letters, digits, hyphens)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}