feat(meta): version command
This commit is contained in:
parent
2dead7de0a
commit
315703d46b
5 changed files with 21 additions and 7 deletions
|
|
@ -4,6 +4,7 @@ use crate::branding;
|
|||
pub enum MetaCommand {
|
||||
Exit,
|
||||
About,
|
||||
Version,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for MetaCommand {
|
||||
|
|
@ -11,6 +12,7 @@ impl std::fmt::Display for MetaCommand {
|
|||
match self {
|
||||
MetaCommand::Exit => write!(f, "exit"),
|
||||
MetaCommand::About => write!(f, "about"),
|
||||
MetaCommand::Version => write!(f, "version"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,9 +26,13 @@ impl MetaCommand {
|
|||
match self {
|
||||
MetaCommand::Exit => MetaCommandExecuteResult { should_exit: true },
|
||||
MetaCommand::About => {
|
||||
print!("{}", branding::about_msg());
|
||||
MetaCommandExecuteResult { should_exit: false }
|
||||
}
|
||||
print!("{}", branding::about_msg());
|
||||
MetaCommandExecuteResult { should_exit: false }
|
||||
}
|
||||
MetaCommand::Version => {
|
||||
print!("{}", branding::version_msg());
|
||||
MetaCommandExecuteResult { should_exit: false }
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue