feat(meta): add about meta-command
This commit is contained in:
parent
c863d71409
commit
2dead7de0a
6 changed files with 39 additions and 5 deletions
|
|
@ -1,12 +1,16 @@
|
|||
use crate::branding;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub enum MetaCommand {
|
||||
Exit,
|
||||
About,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for MetaCommand {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
MetaCommand::Exit => write!(f, "exit"),
|
||||
MetaCommand::About => write!(f, "about"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +23,10 @@ impl MetaCommand {
|
|||
pub fn execute(&self) -> MetaCommandExecuteResult {
|
||||
match self {
|
||||
MetaCommand::Exit => MetaCommandExecuteResult { should_exit: true },
|
||||
MetaCommand::About => {
|
||||
print!("{}", branding::about_msg());
|
||||
MetaCommandExecuteResult { should_exit: false }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue