--- a/cmds/jrsonnet/src/main.rs +++ b/cmds/jrsonnet/src/main.rs @@ -56,6 +56,9 @@ struct Opts { #[clap(subcommand)] sub: Option, + /// Print version + #[clap(long)] + version: bool, #[clap(flatten)] input: InputOpts, @@ -81,6 +84,11 @@ fn main() { let opts: Opts = Opts::parse(); + if opts.version { + print!("{}", Opts::command().render_version()); + std::process::exit(0) + } + if let Some(sub) = opts.sub { match sub { SubOpts::Generate { shell } => {