feat: rename `.clear messages` to `.empty session` (#923)

pull/926/head
sigoden 4 days ago committed by GitHub
parent aaea0ff702
commit 9935ecc12f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -71,7 +71,7 @@ lazy_static::lazy_static! {
AssertState::False(StateFlags::SESSION_EMPTY | StateFlags::SESSION), AssertState::False(StateFlags::SESSION_EMPTY | StateFlags::SESSION),
), ),
ReplCommand::new( ReplCommand::new(
".clear messages", ".empty session",
"Erase messages in the current session", "Erase messages in the current session",
AssertState::True(StateFlags::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" => { ".rebuild" => {
match args.map(|v| match v.split_once(' ') { match args.map(|v| match v.split_once(' ') {
Some((subcmd, args)) => (subcmd, Some(args.trim())), Some((subcmd, args)) => (subcmd, Some(args.trim())),
@ -475,7 +483,7 @@ impl Repl {
}, },
".clear" => match args { ".clear" => match args {
Some("messages") => { Some("messages") => {
self.config.write().empty_session()?; bail!("Use '.empty session' instead");
} }
_ => unknown_command()?, _ => unknown_command()?,
}, },

Loading…
Cancel
Save