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 = [
1529 "unicode-segmentation", 1529 "unicode-segmentation",
1530 "unicode-width", 1530 "unicode-width",
1531 "url", 1531 "url",
1532 "vergen",
1532] 1533]
1533 1534
1534[[package]] 1535[[package]]
@@ -3135,6 +3136,12 @@ dependencies = [
3135 "base64 0.21.0", 3136 "base64 0.21.0",
3136] 3137]
3137 3138
3139[[package]]
3140name = "rustversion"
3141version = "1.0.12"
3142source = "registry+https://github.com/rust-lang/crates.io-index"
3143checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
3144
3138[[package]] 3145[[package]]
3139name = "ryu" 3146name = "ryu"
3140version = "1.0.13" 3147version = "1.0.13"
@@ -3974,6 +3981,17 @@ version = "0.1.0"
3974source = "registry+https://github.com/rust-lang/crates.io-index" 3981source = "registry+https://github.com/rust-lang/crates.io-index"
3975checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 3982checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
3976 3983
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
3977[[package]] 3995[[package]]
3978name = "version_check" 3996name = "version_check"
3979version = "0.9.4" 3997version = "0.9.4"
Cargo.toml +6
@@ -12,6 +12,12 @@ exclude = [".github", "CONTRIBUTING.md"]
12keywords = ["matrix", "chat", "tui", "vim"] 12keywords = ["matrix", "chat", "tui", "vim"]
13categories = ["command-line-utilities"] 13categories = ["command-line-utilities"]
14rust-version = "1.66" 14rust-version = "1.66"
15build = "build.rs"
16
17[build-dependencies.vergen]
18version = "8"
19default-features = false
20features = ["build", "git", "gitcl",]
15 21
16[dependencies] 22[dependencies]
17arboard = "3.2.0" 23arboard = "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>) {
89 } 89 }
90} 90}
91 91
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
92#[derive(Parser)] 97#[derive(Parser)]
93#[clap(version, about, long_about = None)] 98#[clap(version = VERSION, about, long_about = None)]
94#[clap(propagate_version = true)] 99#[clap(propagate_version = true)]
95pub struct Iamb { 100pub struct Iamb {
96 #[clap(short = 'P', long, value_parser)] 101 #[clap(short = 'P', long, value_parser)]
src/windows/mod.rs +1 −1
@@ -538,7 +538,7 @@ impl Window<IambInfo> for IambWindow {
538 title.into(), 538 title.into(),
539 ]; 539 ];
540 Spans(v) 540 Spans(v)
541 } 541 },
542 } 542 }
543 } 543 }
544 544