summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-10-14 18:30:48 +0800
committerGitHub <noreply@github.com>2024-10-14 18:30:48 +0800
commit9935ecc12f9d84c4eb5c663f8d9362f6529d4ef2 (patch)
treed77593635cc27e7105aabfee2eb518e5e94c0c10 /src
parentaaea0ff7029356108c59198fbbad505277a7c05e (diff)
downloadaichat-9935ecc12f9d84c4eb5c663f8d9362f6529d4ef2.tar.gz
feat: rename `.clear messages` to `.empty session` (#923)
Diffstat (limited to 'src')
-rw-r--r--src/repl/mod.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs
index 5a741c2..9a70ba5 100644
--- a/src/repl/mod.rs
+++ b/src/repl/mod.rs
@@ -71,7 +71,7 @@ lazy_static::lazy_static! {
AssertState::False(StateFlags::SESSION_EMPTY | StateFlags::SESSION),
),
ReplCommand::new(
- ".clear messages",
+ ".empty session",
"Erase messages in the current session",
AssertState::True(StateFlags::SESSION)
),
@@ -382,6 +382,14 @@ impl Repl {
}
}
}
+ ".empty" => match args {
+ Some("session") => {
+ self.config.write().empty_session()?;
+ }
+ _ => {
+ println!(r#"Usage: .empty session"#)
+ }
+ },
".rebuild" => {
match args.map(|v| match v.split_once(' ') {
Some((subcmd, args)) => (subcmd, Some(args.trim())),
@@ -475,7 +483,7 @@ impl Repl {
},
".clear" => match args {
Some("messages") => {
- self.config.write().empty_session()?;
+ bail!("Use '.empty session' instead");
}
_ => unknown_command()?,
},