Files
pezkuwi-subxt/cli/src/commands/version.rs
T
James Wilson 08d6640a6c Expose version info in CLI tool with build-time obtained git hash (#787)
* version info with built-time obtained git hash

* clippy

* rerun-if-changed properly and handle git command failing

* cargo fmt
2023-01-17 17:29:12 +00:00

17 lines
334 B
Rust

use clap::Parser as ClapParser;
/// Prints version information
#[derive(Debug, ClapParser)]
pub struct Opts {}
pub fn run(_opts: Opts) -> color_eyre::Result<()> {
let git_hash = env!("GIT_HASH");
println!(
"{} {}-{}",
clap::crate_name!(),
clap::crate_version!(),
git_hash
);
Ok(())
}