diff options
| author | sigoden <sigoden@gmail.com> | 2024-10-14 18:30:48 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-14 18:30:48 +0800 |
| commit | 9935ecc12f9d84c4eb5c663f8d9362f6529d4ef2 (patch) | |
| tree | d77593635cc27e7105aabfee2eb518e5e94c0c10 /src | |
| parent | aaea0ff7029356108c59198fbbad505277a7c05e (diff) | |
| download | aichat-9935ecc12f9d84c4eb5c663f8d9362f6529d4ef2.tar.gz | |
feat: rename `.clear messages` to `.empty session` (#923)
Diffstat (limited to 'src')
| -rw-r--r-- | src/repl/mod.rs | 12 |
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()?, }, |
