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