{"record":{"id":"5fe31b3f8571817c","repo":"kovidgoyal/kitty","slug":"s-is-not-valid-mime-alias-specification","errorCode":null,"errorMessage":"%s is not valid MIME alias specification","messagePattern":"(.+?) is not valid MIME alias specification","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/clipboard/read.go","lineNumber":281,"sourceCode":"\t\t\trp := bytes.SplitN(record, utils.UnsafeStringToBytes(\"=\"), 2)\n\t\t\tv := \"\"\n\t\t\tif len(rp) == 2 {\n\t\t\t\tv = string(rp[1])\n\t\t\t}\n\t\t\tk := string(rp[0])\n\t\t\tmetadata[k] = unescape_metadata_value(k, v)\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc parse_aliases(raw []string) (map[string][]string, error) {\n\tans := make(map[string][]string, len(raw))\n\tfor _, x := range raw {\n\t\tk, v, found := strings.Cut(x, \"=\")\n\t\tif !found {\n\t\t\treturn nil, fmt.Errorf(\"%s is not valid MIME alias specification\", x)\n\t\t}\n\t\tans[k] = append(ans[k], v)\n\t\tans[v] = append(ans[v], k)\n\t}\n\treturn ans, nil\n}\n\nfunc run_get_loop(opts *Options, args []string) (err error) {\n\tlp, err := loop.NewForSimpleInteraction()\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar available_mimes []string\n\tvar wg sync.WaitGroup\n\tvar getting_data_for string\n\trequested_mimes := make(map[string]*Output)\n\treading_available_mimes := true\n\toutputs := make([]*Output, len(args))","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/clipboard/read.go#L263-L299","documentation":"--alias values must be of the form FROM=TO. parse_aliases splits each entry on the first '=' and rejects any entry lacking one, reporting the offending string. Each alias is registered bidirectionally (both directions map to each other).","triggerScenarios":"Passing `--alias image/png` (no '='), `--alias image/png image/jpeg` (space instead of '='), or an empty --alias value; also `--alias =` style degenerate entries still parse but map empty strings.","commonSituations":"Users writing alias pairs space-separated as if they were two flags; shell quoting that strips the equals sign; scripts building alias lists that skip the '=' when the target is empty.","solutions":["Use '=' syntax: `--alias image/bmp=image/png`","For multiple aliases repeat the flag: `--alias a=b --alias b=c`","Verify shell quoting: `--alias \"$a=$b\"` when composing from variables"],"exampleFix":"# before\nkitten clipboard get --alias image/bmp image/png out\n# after\nkitten clipboard get --alias image/bmp=image/png out","handlingStrategy":"validation","validationCode":"for a in \"${ALIASES[@]}\"; do [[ \"$a\" == *=* ]] || { echo \"bad alias: $a\"; exit 2; }; done","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate FROM=TO shape in wrappers","Quote composed aliases as \"$a=$b\""],"tags":["kitty","clipboard","cli-arguments","alias","parsing"],"backgroundTag":"invalid-argument-format","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}