feat(meta): version command

This commit is contained in:
Khaïs COLIN 2025-05-31 15:59:58 +02:00
parent 2dead7de0a
commit 315703d46b
Signed by: logistic-bot
SSH key fingerprint: SHA256:3zI3/tx0ZpCLHCLPmEaGR4oeYCPMCzQxXhXutBmtOAU
5 changed files with 21 additions and 7 deletions

View file

@ -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 }
},
}
}
}