diff --git a/ROADMAP.md b/ROADMAP.md index d30f3982..8856d1aa 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -7669,3 +7669,5 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed) 750. **`claw prompt --output-format json` (no text argument) returned `error_kind:"unknown"` and `hint: null`** — dogfooded 2026-05-26 on `2dfb7af6`. The error string `"prompt subcommand requires a prompt string"` had no prefix prefix for classifier and no `\n` for hint extraction. Fix: (a) prefix with `"missing_prompt: "` + newline before usage hint; (b) add `message.starts_with("missing_prompt:")` → `"missing_prompt"` classifier arm. Result: `error_kind:"missing_prompt"`, `hint:"Usage: claw prompt or echo '' | claw"`. Source: Jobdori dogfood on `2dfb7af6`, 2026-05-26. 751. **ROADMAP #750 has no regression test: `claw prompt --output-format json` no-arg `error_kind` and `hint` could silently regress** — confirmed by gaebal-gajae on `ac925ed4`. Fix: add `prompt_no_arg_json_error_kind_750` test asserting nonzero exit, `error_kind:"missing_prompt"`, non-empty `hint` mentioning `claw prompt` or `echo`. Source: gaebal-gajae dogfood on `ac925ed4`, 2026-05-26. + +752. **`claw --output-format json ` returned `hint: null` for all `cli_parse` errors when an unrecognized positional arg was supplied** — dogfooded 2026-05-26 on `ddc71b56`. Generic `unrecognized argument` format string had no `\n` so `split_error_hint` emitted null hint (only the `--json` special-case added a hint). Fix: add else-branch appending `\nRun `claw --help` for usage.` to the generic arm. Affected surfaces: `sandbox`, `doctor`, `version`, and any other subcommand routing through the same unrecognized-arg path. Source: Jobdori dogfood on `ddc71b56`, 2026-05-26. diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs index 40df0cb5..5cb4bdc5 100644 --- a/rust/crates/rusty-claude-cli/src/main.rs +++ b/rust/crates/rusty-claude-cli/src/main.rs @@ -1326,6 +1326,9 @@ fn parse_single_word_command_alias( // Hint at the correct flag so they don't have to re-read --help. if rest[1] == "--json" { msg.push_str("\nDid you mean `--output-format json`?"); + } else { + // #752: generic fallback hint so cli_parse errors always have non-null hint + msg.push_str(&format!("\nRun `claw {} --help` for usage.", verb)); } return Some(Err(msg)); }