diff --git a/build.rs b/build.rs deleted file mode 100644 index 20ecf3f..0000000 --- a/build.rs +++ /dev/null @@ -1,17 +0,0 @@ -use std::process::Command; - -fn main() { - let version = Command::new(if cfg!(windows) { "git.exe" } else { "git" }) - .args(["describe", "--match=cargo-smart-release-*"]) - .output() - .ok() - .and_then(|out| parse_describe(&out.stdout)) - .unwrap_or_else(|| env!("CARGO_PKG_VERSION").into()); - - println!("cargo:rustc-env=CARGO_SMART_RELEASE_VERSION={version}"); -} - -fn parse_describe(input: &[u8]) -> Option { - let input = std::str::from_utf8(input).ok()?; - input.trim().to_owned().into() -} diff --git a/src/cli/options.rs b/src/cli/options.rs index 6cd932c..ba229ea 100644 --- a/src/cli/options.rs +++ b/src/cli/options.rs @@ -1,8 +1,7 @@ #[derive(clap::Parser)] #[clap(subcommand_required = true)] #[clap(disable_help_subcommand = true)] -#[clap(disable_version_flag = true)] -#[clap(bin_name = "cargo")] +#[clap(bin_name = "cargo", version = env!("CARGO_PKG_VERSION"))] /// Release workspace crates fearlessly. /// /// Use --execute to actually perform the operation. @@ -13,7 +12,7 @@ pub struct Args { #[derive(clap::Parser)] pub enum SubCommands { - #[clap(name = "smart-release", version = option_env!("CARGO_SMART_RELEASE_VERSION"))] + #[clap(name = "smart-release", version = env!("CARGO_PKG_VERSION"))] /// Release workspace crates fearlessly. /// /// Use --execute to actually perform the operation. @@ -179,7 +178,7 @@ pub enum SubCommands { #[clap(long, help_heading = Some("CUSTOMIZATION"))] commit_prefix: Option, }, - #[clap(name = "changelog", version = option_env!("CARGO_SMART_RELEASE_VERSION"))] + #[clap(name = "changelog", version = env!("CARGO_PKG_VERSION"))] /// Generate changelogs from commit histories, non-destructively. /// /// Use --write to actually write generated changelogs