]> git.r.bdr.sh - rbdr/blog/blame - src/command/version.rs
Add status command
[rbdr/blog] / src / command / version.rs
CommitLineData
d620665f
RBR
1use std::io::Result;
2
3pub struct Version;
4
5impl Version {
6 pub fn new() -> Self {
7 Version
8 }
9}
10
11impl super::Command for Version {
12 fn before_dependencies(&self) -> Vec<Box<dyn super::Command>> {
13 vec![]
14 }
15
5f81d796
RBR
16 fn execute(&self, _: Option<&String>) -> Result<()> {
17 let version = env!("CARGO_PKG_VERSION");
18 println!("{}", version);
d620665f
RBR
19 return Ok(())
20 }
21
22 fn after_dependencies(&self) -> Vec<Box<dyn super::Command>> {
23 vec![]
24 }
25
26 fn command(&self) -> &'static str {
27 "version"
28 }
29
30 fn help(&self) -> &'static str {
31 "\t\t\t\tPrints the version"
32 }
33}