{"record":{"id":"8b2d10d5facd62c0","repo":"chenhg5/cc-connect","slug":"unknown-option-s","errorCode":null,"errorMessage":"unknown option: %s","messagePattern":"unknown option: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/tuitui.go","lineNumber":363,"sourceCode":"\t\t\topts.channelID = v\n\t\tcase \"--parent\", \"--parent-id\":\n\t\t\tv, err := value()\n\t\t\tif err != nil {\n\t\t\t\treturn opts, err\n\t\t\t}\n\t\t\topts.parentID = v\n\t\tcase \"--message\", \"-m\":\n\t\t\tv, err := value()\n\t\t\tif err != nil {\n\t\t\t\treturn opts, err\n\t\t\t}\n\t\t\topts.message = v\n\t\tcase \"--stdin\":\n\t\t\topts.stdin = true\n\t\tcase \"--help\", \"-h\":\n\t\t\treturn opts, errTuiTuiUsage\n\t\tdefault:\n\t\t\treturn opts, fmt.Errorf(\"unknown option: %s\", arg)\n\t\t}\n\t}\n\tif opts.configPath == \"\" {\n\t\topts.configPath = resolveConfigPath(\"\")\n\t}\n\treturn opts, nil\n}\n\nvar errTuiTuiUsage = errors.New(\"show tuitui usage\")\n\nfunc loadTuiTuiPlatform(opts tuituiCLIOptions) (*tuitui.Platform, error) {\n\tplatformOpts := map[string]any{}\n\tif opts.configPath != \"\" {\n\t\tcfg, err := config.Load(opts.configPath)\n\t\tif err != nil {\n\t\t\tif opts.configSet {\n\t\t\t\treturn nil, err\n\t\t\t}","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/tuitui.go#L345-L381","documentation":"parseTuiTuiArgs has a fixed allow-list of flags; any unrecognized argument hits the default branch and returns \"unknown option: %s\". This is strict parsing — no prefix matching or abbreviation is supported.","triggerScenarios":"Misspelled flags (--maxbytes, --limt), flags belonging to other subcommands, positional arguments passed where not supported, or a leading dash value like `--project -x`.","commonSituations":"Typo in flag name; mixing flags from the download subcommand into post; outdated muscle memory after a flag rename; running `cc-connect tuitui` with stray positional args.","solutions":["Check the flag list with --help/-h (which returns the usage via errTuiTuiUsage)","Fix the typo in the flag name","Remove unsupported positional arguments or quote values beginning with - as --flag=-value"],"exampleFix":"// before\ncc-connect tuitui post --maxbytes 100\n// after\ncc-connect tuitui post --max-bytes 100","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"--config\":true, \"--limit\":true, \"--max-bytes\":true, \"--project\":true, \"--help\":true, \"-h\":true}\nfor _, a := range args {\n\tif strings.HasPrefix(a, \"-\") && !allowed[a] {\n\t\treturn fmt.Errorf(\"unknown option %s (see --help)\", a)\n\t}\n}","typeGuard":null,"tryCatchPattern":"opts, err := parseTuiTuiArgs(args)\nif errors.Is(err, errTuiTuiUsage) {\n\tprintUsage(); os.Exit(0)\n} else if err != nil {\n\tfmt.Fprintln(os.Stderr, err); os.Exit(2)\n}","preventionTips":["Run --help before inventing flag names","Watch for flag renames across versions","Don't mix flags between tuitui subcommands"],"tags":["cli","flag","argument-parsing"],"backgroundTag":"invalid-cli-argument","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}