{"record":{"id":"16bf96cc32e53e83","repo":"Hmbown/CodeWhale","slug":"use-one-of-a-prompt-status-list-show-id-or-cancel-id","errorCode":null,"errorMessage":"Use one of: a prompt, --status, --list, --show <id>, or --cancel <id>.","messagePattern":"Use one of: a prompt, --status, --list, --show <id>, or --cancel <id>\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/dispatch.rs","lineNumber":81,"sourceCode":"pub(crate) fn run(args: DispatchArgs) -> Result<()> {\n    let mut out = io::stdout().lock();\n    run_with(args, &mut out)\n}\n\nfn run_with<W: Write>(args: DispatchArgs, out: &mut W) -> Result<()> {\n    if [\n        args.status,\n        args.list,\n        args.show.is_some(),\n        args.cancel.is_some(),\n        !args.prompt.is_empty(),\n    ]\n    .iter()\n    .filter(|flag| **flag)\n    .count()\n        > 1\n    {\n        bail!(\"Use one of: a prompt, --status, --list, --show <id>, or --cancel <id>.\");\n    }\n\n    let workspace = args\n        .cwd\n        .clone()\n        .unwrap_or_else(|| std::env::current_dir().unwrap_or_else(|_| PathBuf::from(\".\")));\n    let remotes = discover_remotes(&workspace);\n    let credentials = discover_credentials();\n    let store = CloudJobStore::from_env()?;\n\n    if args.status\n        || (args.prompt.is_empty() && args.show.is_none() && args.cancel.is_none() && !args.list)\n    {\n        writeln!(\n            out,\n            \"{}\",\n            format_status(&remotes, &credentials, &recent_jobs(&store))\n        )?;","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/dispatch.rs#L63-L99","documentation":"This error is thrown by the CLI dispatch layer (`run_with` in crates/cli/src/dispatch.rs) when the user supplied more than one mutually exclusive top-level invocation mode at once (e.g. a positional prompt together with --status, --list, --show, or --cancel). The dispatch loop counts the enabled mode flags and refuses any combination greater than one, since exactly one action per invocation is the only well-defined dispatch. It exists to give a clear usage message instead of silently picking one mode.","triggerScenarios":"Running `codewhale \"do stuff\" --status`, `codewhale --list --show job1`, or any invocation where the `.iter().filter(|flag| **flag).count() > 1` check over the mode flags ([status, list, show, cancel] plus presence of a prompt) is satisfied by two or more flags.","commonSituations":"Shell scripts appending a default flag to a user-supplied command; typos where an id like `--show abc --status` was meant to be a single subcommand; muscle memory from tools where a flag and prompt can combine; copied example commands that were concatenated.","solutions":["Remove all but one invocation mode: either a positional prompt, or exactly one of --status, --list, --show <id>, --cancel <id>.","If you wanted to run a prompt AND query status, split it into two separate CLI invocations.","Check the shell script/alias composing the command line for a hardcoded flag that duplicates the interactive one."],"exampleFix":"// before\ncodewhale \"refactor module\" --status\n// after\ncodewhale --status\ncodewhale \"refactor module\"","handlingStrategy":"validation","validationCode":"const MODES = ['--status','--list','--show','--cancel'];\nconst argv = process.argv.slice(2);\nconst used = MODES.filter(f => argv.includes(f));\nconst hasPrompt = argv.some(a => !a.startsWith('--'));\nif (used.length + (hasPrompt ? 1 : 0) > 1) throw new Error('Use one invocation mode per codewhale call');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["One action per CLI invocation; chain multiple actions in the shell instead.","Lint wrapper scripts for flags appended to user-supplied commands."],"tags":["cli","argument-parsing","mutually-exclusive"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}