From 5e80b8c3309e9aa56f27a0bba449ce70e8920ee4 Mon Sep 17 00:00:00 2001 From: evilsocket Date: Wed, 30 Oct 2024 17:18:54 +0100 Subject: [PATCH] new: version subcommand --- src/cli/mod.rs | 2 ++ src/main.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 57767e4..49ac985 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -31,6 +31,8 @@ pub(crate) enum Command { Verify(VerifyArgs), /// Generate a DOT representation of the graph of the model. Graph(GraphArgs), + /// Print version and exit. + Version, } #[derive(Debug, Clone, ValueEnum)] diff --git a/src/main.rs b/src/main.rs index b2b5dfb..edb772d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,6 +13,10 @@ fn main() { Command::Sign(args) => cli::sign(args), Command::Verify(args) => cli::verify(args), Command::Graph(args) => cli::graph(args), + Command::Version => { + println!("{} v{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")); + Ok(()) + } }; if let Err(e) = ret {