mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-28 16:36:45 +00:00
fix(#785): add unknown_subcommand classifier arm for unknown subcommand: prose prefix
This commit is contained in:
@@ -349,6 +349,9 @@ fn classify_error_kind(message: &str) -> &'static str {
|
||||
} else if message.contains("has been removed.") {
|
||||
// #765: removed subcommands (login, logout) — hint contains migration guidance
|
||||
"removed_subcommand"
|
||||
} else if message.starts_with("unknown subcommand:") {
|
||||
// #785: typo/unknown top-level subcommand (e.g. `claw dump` → did you mean dump-manifests?)
|
||||
"unknown_subcommand"
|
||||
} else if message.starts_with("unexpected extra arguments")
|
||||
|| message.starts_with("unexpected_extra_args:")
|
||||
{
|
||||
@@ -13009,6 +13012,11 @@ mod tests {
|
||||
classify_error_kind("unrecognized argument `--foo` for subcommand `doctor`"),
|
||||
"cli_parse"
|
||||
);
|
||||
// #785: unknown top-level subcommand (typo or unrecognised command)
|
||||
assert_eq!(
|
||||
classify_error_kind("unknown subcommand: dump.\nDid you mean dump-manifests"),
|
||||
"unknown_subcommand"
|
||||
);
|
||||
assert_eq!(
|
||||
classify_error_kind("unsupported ACP invocation. Use `claw acp`."),
|
||||
"unsupported_acp_invocation"
|
||||
|
||||
Reference in New Issue
Block a user