{"record":{"id":"1db0478e7e910eb7","repo":"chenhg5/cc-connect","slug":"image-requires-a-path","errorCode":null,"errorMessage":"--image requires a path","messagePattern":"--image requires a path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/send.go","lineNumber":115,"sourceCode":"\t\t\t\treturn req, \"\", fmt.Errorf(\"--message requires a value\")\n\t\t\t}\n\t\t\ti++\n\t\t\treq.Message = args[i]\n\t\tcase \"--cwd\", \"--work-dir\":\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.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\")","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/send.go#L97-L133","documentation":"The --image flag of `cc-connect send` requires exactly one path argument per occurrence. If --image is the last argument or is followed by another flag, parseSendArgs returns \"--image requires a path\". This is a usage error caught before any file I/O.","triggerScenarios":"`cc-connect send --image` with no trailing path; `cc-connect send --image --message hi`; an empty variable expansion leaving `--image` dangling.","commonSituations":"Shell variable holding the path is unset/empty (`--image $IMG` with IMG=\"\"), path with spaces unquoted so it splits into two args, copy-paste drops the filename.","solutions":["Append the image path right after the flag: `--image ./screenshot.png`.","Quote paths containing spaces: `--image \"my shot.png\"`.","Check that shell variables are non-empty before invocation.","Repeat --image for each image; never bundle multiple paths in one value."],"exampleFix":"// before\ncc-connect send --image\n// after\ncc-connect send --image ./screenshots/bug.png","handlingStrategy":"validation","validationCode":"IMG=./shot.png\n[ -n \"$IMG\" ] || { echo \"image path empty\"; exit 1; }\ncc-connect send --image \"$IMG\"","typeGuard":null,"tryCatchPattern":"try { await $`cc-connect send --image ${img}`; }\ncatch (e) { if (String(e).includes('--image requires a path')) console.error('Supply a path after --image'); }","preventionTips":["Never leave --image as the last argument.","Quote paths with spaces.","Verify shell variables holding image paths are non-empty.","One path per --image occurrence."],"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-14T00:17:10.932Z"}