Show commit in --version and ledger-tool's log (#12636)

* Show commit in `--version` and ledger-tool's log

* Another handy hidden env var

* Fix test

* Rename to semver!

* Fix syntax error...
This commit is contained in:
Ryo Onodera
2020-10-04 00:30:26 +09:00
committed by GitHub
parent 337da184f3
commit 026e7de819
4 changed files with 14 additions and 3 deletions

View File

@ -91,12 +91,19 @@ impl fmt::Debug for Version {
impl Sanitize for Version {}
#[macro_export]
macro_rules! version {
macro_rules! semver {
() => {
&*format!("{}", $crate::Version::default())
};
}
#[macro_export]
macro_rules! version {
() => {
&*format!("{:?}", $crate::Version::default())
};
}
#[cfg(test)]
mod test {
use super::*;