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]] |
| |
3140 | name = "rustversion" |
| |
3141 | version = "1.0.12" |
| |
3142 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| |
3143 | checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" |
| |
3144 | |
| 3138 | [[package]] |
3145 | [[package]] |
| 3139 | name = "ryu" |
3146 | name = "ryu" |
| 3140 | version = "1.0.13" |
3147 | version = "1.0.13" |
| @@ -3974,6 +3981,17 @@ version = "0.1.0" |
| 3974 | source = "registry+https://github.com/rust-lang/crates.io-index" |
3981 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 3975 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" |
3982 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" |
| 3976 | |
3983 | |
| |
3984 | [[package]] |
| |
3985 | name = "vergen" |
| |
3986 | version = "8.2.1" |
| |
3987 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| |
3988 | checksum = "8b3c89c2c7e50f33e4d35527e5bf9c11d6d132226dbbd1753f0fbe9f19ef88c6" |
| |
3989 | dependencies = [ |
| |
3990 | "anyhow", |
| |
3991 | "rustversion", |
| |
3992 | "time 0.3.20", |
| |
3993 | ] |
| |
3994 | |
| 3977 | [[package]] |
3995 | [[package]] |
| 3978 | name = "version_check" |
3996 | name = "version_check" |
| 3979 | version = "0.9.4" |
3997 | version = "0.9.4" |
Cargo.toml
+6
| @@ -12,6 +12,12 @@ exclude = [".github", "CONTRIBUTING.md"] |
| 12 | keywords = ["matrix", "chat", "tui", "vim"] |
12 | keywords = ["matrix", "chat", "tui", "vim"] |
| 13 | categories = ["command-line-utilities"] |
13 | categories = ["command-line-utilities"] |
| 14 | rust-version = "1.66" |
14 | rust-version = "1.66" |
| |
15 | build = "build.rs" |
| |
16 | |
| |
17 | [build-dependencies.vergen] |
| |
18 | version = "8" |
| |
19 | default-features = false |
| |
20 | features = ["build", "git", "gitcl",] |
| 15 | |
21 | |
| 16 | [dependencies] |
22 | [dependencies] |
| 17 | arboard = "3.2.0" |
23 | arboard = "3.2.0" |
build.rs
added
+7
| @@ -0,0 +1,7 @@ |
| |
1 | use std::error::Error; |
| |
2 | use vergen::EmitBuilder; |
| |
3 | |
| |
4 | fn 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 | |
| |
92 | const 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)] |
| 95 | pub struct Iamb { |
100 | pub 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 | |