Commit 2a573b6056

2a573b6056caae91ddbb842c30e5c0d19608b86d

parent: a020b860dd

Unregistered key

Ulyssa <git@ulyssa.dev> · 2023-06-15 03:28 UTC

Show Git SHA information when printing version information (#120)

Layout: unified · split

Cargo.lock +18
@@ -1529,6 +1529,7 @@ dependencies = [
15291529 "unicode-segmentation",
15301530 "unicode-width",
15311531 "url",
1532 "vergen",
15321533]
15331534
15341535[[package]]
@@ -3135,6 +3136,12 @@ dependencies = [
31353136 "base64 0.21.0",
31363137]
31373138
3139[[package]]
3140name = "rustversion"
3141version = "1.0.12"
3142source = "registry+https://github.com/rust-lang/crates.io-index"
3143checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
3144
31383145[[package]]
31393146name = "ryu"
31403147version = "1.0.13"
@@ -3974,6 +3981,17 @@ version = "0.1.0"
39743981source = "registry+https://github.com/rust-lang/crates.io-index"
39753982checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
39763983
3984[[package]]
3985name = "vergen"
3986version = "8.2.1"
3987source = "registry+https://github.com/rust-lang/crates.io-index"
3988checksum = "8b3c89c2c7e50f33e4d35527e5bf9c11d6d132226dbbd1753f0fbe9f19ef88c6"
3989dependencies = [
3990 "anyhow",
3991 "rustversion",
3992 "time 0.3.20",
3993]
3994
39773995[[package]]
39783996name = "version_check"
39793997version = "0.9.4"
Cargo.toml +6
@@ -12,6 +12,12 @@ exclude = [".github", "CONTRIBUTING.md"]
1212keywords = ["matrix", "chat", "tui", "vim"]
1313categories = ["command-line-utilities"]
1414rust-version = "1.66"
15build = "build.rs"
16
17[build-dependencies.vergen]
18version = "8"
19default-features = false
20features = ["build", "git", "gitcl",]
1521
1622[dependencies]
1723arboard = "3.2.0"
build.rs added +7
@@ -0,0 +1,7 @@
1use std::error::Error;
2use vergen::EmitBuilder;
3
4fn main() -> Result<(), Box<dyn Error>> {
5 EmitBuilder::builder().git_sha(true).emit()?;
6 Ok(())
7}
src/config.rs +6 −1
@@ -89,8 +89,13 @@ fn validate_profile_names(names: &HashMap<String, ProfileConfig>) {
8989 }
9090}
9191
92const VERSION: &str = match option_env!("VERGEN_GIT_SHA") {
93 None => env!("CARGO_PKG_VERSION"),
94 Some(_) => concat!(env!("CARGO_PKG_VERSION"), " (", env!("VERGEN_GIT_SHA"), ")"),
95};
96
9297#[derive(Parser)]
93#[clap(version, about, long_about = None)]
98#[clap(version = VERSION, about, long_about = None)]
9499#[clap(propagate_version = true)]
95100pub struct Iamb {
96101 #[clap(short = 'P', long, value_parser)]
src/windows/mod.rs +1 −1
@@ -538,7 +538,7 @@ impl Window<IambInfo> for IambWindow {
538538 title.into(),
539539 ];
540540 Spans(v)
541 }
541 },
542542 }
543543 }
544544