summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2023-01-02 15:18:05 -0500
committerGitHub <noreply@github.com>2023-01-02 15:18:05 -0500
commit7c53f088c3933812847b7359c50cad8c0fa315a4 (patch)
tree20bc95fc687b6ffa42fda53f0b795f1f69762f07 /src
parenta56e7f6cc9c0515d15576c7b06392c0b0c79b288 (diff)
ci: add build hash to nightly builds for version (#951)
This adds the build hash to the btm -V output for nightly builds, making it easier to troubleshoot when someone might have obtained a nightly build, and what commit it corresponds to.
Diffstat (limited to 'src')
-rw-r--r--src/clap.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/clap.rs b/src/clap.rs
index 3903eb61..f3333d8c 100644
--- a/src/clap.rs
+++ b/src/clap.rs
@@ -368,9 +368,14 @@ use CPU (3) as the default instead.
.help("The timespan of data kept.")
.long_help("How much data is stored at once in terms of time. Takes in human-readable time spans (e.g. 10m, 1h), with a minimum of 1 minute. Note higher values will take up more memory. Defaults to 10 minutes.");
+ const VERSION: &str = match option_env!("NIGHTLY_VERSION") {
+ Some(nightly_version) => nightly_version,
+ None => crate_version!(),
+ };
+
#[allow(unused_mut)]
let mut app = Command::new(crate_name!())
- .version(crate_version!())
+ .version(VERSION)
.author(crate_authors!())
.about(crate_description!())
.override_usage(USAGE)