{"record":{"id":"046422ac30eff946","repo":"chenhg5/cc-connect","slug":"audio-requires-a-path","errorCode":null,"errorMessage":"--audio requires a path","messagePattern":"--audio requires a path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/send.go","lineNumber":127,"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.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\":\n\t\t\tif i+1 >= len(args) {\n\t\t\t\treturn req, \"\", fmt.Errorf(\"--at-users requires a value\")\n\t\t\t}\n\t\t\ti++\n\t\t\tfor _, uid := range strings.Split(args[i], \",\") {\n\t\t\t\tuid = strings.TrimSpace(uid)","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/send.go#L109-L145","documentation":"The --audio flag of `cc-connect send` requires a path argument for the audio attachment. parseSendArgs returns \"--audio requires a path\" when the flag has no following argument. Like the other attachment flags, this is caught during argument parsing before any I/O.","triggerScenarios":"`cc-connect send --audio` with no path; `cc-connect send --audio --video v.mp4`; empty variable expansion for the audio path.","commonSituations":"Recording pipeline failed so the file variable is empty; piping through a script that drops the argument; misunderstanding that --audio takes one path per occurrence.","solutions":["Append the audio path: `--audio ./voice.ogg`.","Quote paths containing spaces.","Ensure the producing step (recorder/TTS) actually wrote the file and the variable is non-empty.","Repeat --audio for multiple files instead of comma-separating."],"exampleFix":"// before\ncc-connect send --audio\n// after\ncc-connect send --audio ./recordings/note.ogg","handlingStrategy":"validation","validationCode":"A=./note.ogg\n[ -n \"$A\" ] || { echo \"audio path empty\"; exit 1; }\ncc-connect send --audio \"$A\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Place the path immediately after --audio.","Ensure the recording step completed and wrote the file.","Quote paths with spaces.","Repeat the flag for multiple audio files."],"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"}