mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-31 17:56:44 +00:00
fix: empty-prompt error now returns non-null hint via newline-delimited usage string
claw '' and claw ' ' returned empty_prompt + hint:null because the error message had no newline delimiter. Added usage hint. 61 CLI contract tests pass.
This commit is contained in:
@@ -1378,8 +1378,9 @@ fn parse_args(args: &[String]) -> Result<CliAction, String> {
|
||||
// an empty prompt when credentials are present).
|
||||
let joined = rest.join(" ");
|
||||
if joined.trim().is_empty() {
|
||||
// #798: add \n hint so split_error_hint extracts it (was empty_prompt + null)
|
||||
return Err(
|
||||
"empty prompt: provide a subcommand (run `claw --help`) or a non-empty prompt string"
|
||||
"empty prompt: provide a subcommand or a non-empty prompt string.\nUsage: claw <subcommand> or claw -p <prompt>. Run `claw --help` for the full list."
|
||||
.to_string(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user