Commit 701931846b

701931846bb72d9aa54c7f578a0b862f0fcfa1ec

parent: eb9c3aa32a

Unregistered key

vaw <git@nlih.de> · 2026-10-21 09:30 UTC
committer: <noreply@github.com>

Fix build outside of git worktrees (#825)

Layout: unified · split

Cargo.toml +1 −1
@@ -33,7 +33,7 @@ features = ["build"]
33anyhow = "1.0" 33anyhow = "1.0"
34bitflags = "2.3" 34bitflags = "2.3"
35chrono = "0.4" 35chrono = "0.4"
36clap = {version = "^4.6", features = ["derive"]} 36clap = { version = "^4.6", features = ["derive", "string"] }
37clap_complete = "^4.6" 37clap_complete = "^4.6"
38css-color-parser = "0.1.2" 38css-color-parser = "0.1.2"
39dirs = "7.0" 39dirs = "7.0"
src/config/mod.rs +13 −5
@@ -252,13 +252,21 @@ fn load_themes(
252 Ok(themes) 252 Ok(themes)
253} 253}
254 254
255const VERSION: &str = match option_env!("VERGEN_GIT_SHA") { 255struct IambVersion;
256 None => env!("CARGO_PKG_VERSION"), 256
257 Some(_) => concat!(env!("CARGO_PKG_VERSION"), " (", env!("VERGEN_GIT_SHA"), ")"), 257impl From<IambVersion> for clap::builder::Str {
258}; 258 fn from(_: IambVersion) -> Self {
259 let version: Cow<'static, str> = match option_env!("VERGEN_GIT_SHA") {
260 None => env!("CARGO_PKG_VERSION").into(),
261 Some(sha) => format!("{} ({sha})", env!("CARGO_PKG_VERSION")).into(),
262 };
263
264 version.into()
265 }
266}
259 267
260#[derive(Parser)] 268#[derive(Parser)]
261#[clap(version = VERSION, about, long_about = None)] 269#[clap(version = IambVersion, about, long_about = None)]
262#[clap(propagate_version = true)] 270#[clap(propagate_version = true)]
263pub struct Iamb { 271pub struct Iamb {
264 #[clap(long, value_parser)] 272 #[clap(long, value_parser)]