added git version to compile time variables

This commit is contained in:
Paul 2022-12-29 13:56:36 +01:00
parent 821740ee8a
commit 9644182c4e

View File

@ -68,9 +68,10 @@ impl Context {
}, },
client: Client::builder() client: Client::builder()
.user_agent(format!( .user_agent(format!(
"{}/{}@{}", "{}/{}@{}/{}",
env!("CARGO_PKG_NAME"), env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_VERSION"),
GIT_VERSION,
gethostname(false) gethostname(false)
)) ))
.build() .build()
@ -98,7 +99,7 @@ impl Context {
pub fn argparse() -> ArgMatches { pub fn argparse() -> ArgMatches {
Command::new(env!("CARGO_PKG_NAME")) Command::new(env!("CARGO_PKG_NAME"))
.version(env!("CARGO_PKG_VERSION")) .version(format!("{}/{}", env!("CARGO_PKG_VERSION"), GIT_VERSION).as_str())
.author(env!("CARGO_PKG_AUTHORS")) .author(env!("CARGO_PKG_AUTHORS"))
.about(env!("CARGO_PKG_DESCRIPTION")) .about(env!("CARGO_PKG_DESCRIPTION"))
.arg( .arg(