Add clap_complete for shell completion generation and libc (unix-only) for SIGPIPE handling. Create build.rs to embed the git commit hash at compile time via cargo:rustc-env=GIT_HASH, enabling `lore version` to display the short hash alongside the version number. Co-Authored-By: Claude (us.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
11 lines
337 B
Rust
11 lines
337 B
Rust
fn main() {
|
|
let hash = std::process::Command::new("git")
|
|
.args(["rev-parse", "--short", "HEAD"])
|
|
.output()
|
|
.ok()
|
|
.and_then(|o| String::from_utf8(o.stdout).ok())
|
|
.unwrap_or_default();
|
|
println!("cargo:rustc-env=GIT_HASH={}", hash.trim());
|
|
println!("cargo:rerun-if-changed=.git/HEAD");
|
|
}
|