fix(#791): config extra-arg errors now return non-null hint via \n-delimited usage string

This commit is contained in:
YeonGyu-Kim
2026-05-27 11:04:50 +09:00
parent 9968a27e92
commit 93a159dca5
3 changed files with 71 additions and 1 deletions

View File

@@ -1190,8 +1190,9 @@ fn parse_args(args: &[String]) -> Result<CliAction, String> {
let tail = &rest[1..];
let section = tail.first().cloned();
if tail.len() > 1 {
// #791: append \n hint so split_error_hint extracts it and hint is non-null
return Err(format!(
"unexpected extra arguments after `claw config {}`: {}",
"unexpected extra arguments after `claw config {}`: {}\nUsage: claw config [env|hooks|model|plugins|mcp|settings]",
tail[0],
tail[1..].join(" ")
));