mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 19:11:51 +08:00
Tighten help and clear messaging across the CLI surface
Refresh shared slash help and REPL help wording so the command surface reads more like an integrated console, and make successful /clear output match the newer structured reporting style. This keeps discoverability consistent now that status, model, permissions, config, and cost all use richer operator-oriented copy. Constraint: Help text must stay synchronized with the actual implemented command surface and resume behavior Rejected: Larger README/doc pass in the same commit | keeping the slice limited to runtime help/output makes it easier to review and revert Confidence: high Scope-risk: narrow Reversibility: clean Directive: Prefer shared help-copy changes in commands crate first, then layer REPL-specific additions in the CLI binary Tested: cargo fmt --manifest-path ./rust/Cargo.toml --all; cargo clippy --manifest-path ./rust/Cargo.toml --workspace --all-targets -- -D warnings; cargo test --manifest-path ./rust/Cargo.toml --workspace Not-tested: Manual comparison of help wording against upstream Claude Code terminal screenshots
This commit is contained in:
@@ -623,7 +623,14 @@ impl LiveCli {
|
||||
true,
|
||||
permission_mode_label(),
|
||||
)?;
|
||||
println!("Cleared local session history.");
|
||||
println!(
|
||||
"Session cleared
|
||||
Mode fresh session
|
||||
Preserved model {}
|
||||
Permission mode {}",
|
||||
self.model,
|
||||
permission_mode_label()
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -685,10 +692,16 @@ impl LiveCli {
|
||||
}
|
||||
|
||||
fn render_repl_help() -> String {
|
||||
format!(
|
||||
"{}
|
||||
/exit Quit the REPL",
|
||||
render_slash_command_help()
|
||||
[
|
||||
"REPL".to_string(),
|
||||
" /exit Quit the REPL".to_string(),
|
||||
" /quit Quit the REPL".to_string(),
|
||||
String::new(),
|
||||
render_slash_command_help(),
|
||||
]
|
||||
.join(
|
||||
"
|
||||
",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1351,9 +1364,17 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shared_help_uses_resume_annotation_copy() {
|
||||
let help = commands::render_slash_command_help();
|
||||
assert!(help.contains("Slash commands"));
|
||||
assert!(help.contains("works with --resume SESSION.json"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn repl_help_includes_shared_commands_and_exit() {
|
||||
let help = render_repl_help();
|
||||
assert!(help.contains("REPL"));
|
||||
assert!(help.contains("/help"));
|
||||
assert!(help.contains("/status"));
|
||||
assert!(help.contains("/model [model]"));
|
||||
|
||||
Reference in New Issue
Block a user