{"record":{"id":"6ae4f9951387d645","repo":"chenhg5/cc-connect","slug":"file-requires-a-path","errorCode":null,"errorMessage":"--file requires a path","messagePattern":"--file requires a path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/send.go","lineNumber":121,"sourceCode":"\t\t\t\treturn req, \"\", fmt.Errorf(\"%s requires a value\", args[i])\n\t\t\t}\n\t\t\ti++\n\t\t\treq.WorkDir = args[i]\n\t\tcase \"--tts\":\n\t\t\tif i+1 >= len(args) {\n\t\t\t\treturn req, \"\", fmt.Errorf(\"%s requires a value\", args[i])\n\t\t\t}\n\t\t\ti++\n\t\t\treq.TTSText = args[i]\n\t\tcase \"--image\":\n\t\t\tif i+1 >= len(args) {\n\t\t\t\treturn req, \"\", fmt.Errorf(\"--image requires a path\")\n\t\t\t}\n\t\t\ti++\n\t\t\timagePaths = append(imagePaths, args[i])\n\t\tcase \"--file\":\n\t\t\tif i+1 >= len(args) {\n\t\t\t\treturn req, \"\", fmt.Errorf(\"--file requires a path\")\n\t\t\t}\n\t\t\ti++\n\t\t\tfilePaths = append(filePaths, args[i])\n\t\tcase \"--audio\":\n\t\t\tif i+1 >= len(args) {\n\t\t\t\treturn req, \"\", fmt.Errorf(\"--audio requires a path\")\n\t\t\t}\n\t\t\ti++\n\t\t\taudioPaths = append(audioPaths, args[i])\n\t\tcase \"--video\":\n\t\t\tif i+1 >= len(args) {\n\t\t\t\treturn req, \"\", fmt.Errorf(\"--video requires a path\")\n\t\t\t}\n\t\t\ti++\n\t\t\tvideoPaths = append(videoPaths, args[i])\n\t\tcase \"--stdin\":\n\t\t\tuseStdin = true\n\t\tcase \"--at-users\":","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/send.go#L103-L139","documentation":"The --file flag of `cc-connect send` requires a path argument. parseSendArgs returns \"--file requires a path\" when the flag is last or immediately followed by another flag. It is validated before the file is read or uploaded.","triggerScenarios":"`cc-connect send --file` with nothing after it; `cc-connect send --file --at-users u1`; unquoted glob that fails to expand leaving the flag bare.","commonSituations":"Document path variable empty in CI, glob that matched nothing, truncation when the command is assembled from a template.","solutions":["Provide the path: `--file ./report.pdf`.","Quote paths with spaces: `--file \"my report.pdf\"`.","Verify the variable/glob expands to exactly one path per --file occurrence.","Use `cc-connect send --help` to review attachment flags."],"exampleFix":"// before\ncc-connect send --file\n// after\ncc-connect send --file ./docs/report.pdf","handlingStrategy":"validation","validationCode":"F=./report.pdf\n[ -n \"$F\" ] && [ -f \"$F\" ] || { echo \"file missing or empty var\"; exit 1; }\ncc-connect send --file \"$F\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Place the path immediately after --file.","Quote paths with spaces.","Check glob/variable expansion produced exactly one path.","Confirm the file exists before sending."],"tags":["cli","attachments","argument-parsing"],"backgroundTag":"missing-required-flag","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"}