From 9fb8cd5f865db76d625672f890edaac26a76afac Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 15 Apr 2021 21:52:43 +1200 Subject: [PATCH] Add version flag --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 3705070..59a5c17 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,6 +52,9 @@ struct PluginOptions { #[options(help = "Print this help message and exit.")] help: bool, + #[options(help = "Print version info and exit.", short = "V")] + version: bool, + #[options( help = "Run the given age plugin state machine. Internal use only.", meta = "STATE-MACHINE", @@ -259,6 +262,9 @@ fn main() -> Result<(), Error> { plugin::IdentityPlugin::default, )?; Ok(()) + } else if opts.version { + println!("age-plugin-yubikey {}", env!("CARGO_PKG_VERSION")); + Ok(()) } else if opts.generate { generate(opts) } else if opts.identity {