Add version flag
This commit is contained in:
@@ -52,6 +52,9 @@ struct PluginOptions {
|
|||||||
#[options(help = "Print this help message and exit.")]
|
#[options(help = "Print this help message and exit.")]
|
||||||
help: bool,
|
help: bool,
|
||||||
|
|
||||||
|
#[options(help = "Print version info and exit.", short = "V")]
|
||||||
|
version: bool,
|
||||||
|
|
||||||
#[options(
|
#[options(
|
||||||
help = "Run the given age plugin state machine. Internal use only.",
|
help = "Run the given age plugin state machine. Internal use only.",
|
||||||
meta = "STATE-MACHINE",
|
meta = "STATE-MACHINE",
|
||||||
@@ -259,6 +262,9 @@ fn main() -> Result<(), Error> {
|
|||||||
plugin::IdentityPlugin::default,
|
plugin::IdentityPlugin::default,
|
||||||
)?;
|
)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
} else if opts.version {
|
||||||
|
println!("age-plugin-yubikey {}", env!("CARGO_PKG_VERSION"));
|
||||||
|
Ok(())
|
||||||
} else if opts.generate {
|
} else if opts.generate {
|
||||||
generate(opts)
|
generate(opts)
|
||||||
} else if opts.identity {
|
} else if opts.identity {
|
||||||
|
|||||||
Reference in New Issue
Block a user