Skip to content

Commit 5e80b8c

Browse files
committed
new: version subcommand
1 parent a95669c commit 5e80b8c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/cli/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pub(crate) enum Command {
3131
Verify(VerifyArgs),
3232
/// Generate a DOT representation of the graph of the model.
3333
Graph(GraphArgs),
34+
/// Print version and exit.
35+
Version,
3436
}
3537

3638
#[derive(Debug, Clone, ValueEnum)]

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ fn main() {
1313
Command::Sign(args) => cli::sign(args),
1414
Command::Verify(args) => cli::verify(args),
1515
Command::Graph(args) => cli::graph(args),
16+
Command::Version => {
17+
println!("{} v{}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
18+
Ok(())
19+
}
1620
};
1721

1822
if let Err(e) = ret {

0 commit comments

Comments
 (0)