mirror of
https://github.com/haileys/bark
synced 2024-11-28 14:20:23 +00:00
allow BARK_PKG_VERSION to override CARGO_PKG_VERSION at compile time
This commit is contained in:
parent
0a555d4883
commit
8ee86b901a
1 changed files with 8 additions and 0 deletions
|
@ -14,6 +14,7 @@ use structopt::StructOpt;
|
|||
use thiserror::Error;
|
||||
|
||||
#[derive(StructOpt)]
|
||||
#[structopt(version = version())]
|
||||
enum Opt {
|
||||
Stream(stream::StreamOpt),
|
||||
Receive(receive::ReceiveOpt),
|
||||
|
@ -68,3 +69,10 @@ fn default_log_level() -> LevelFilter {
|
|||
LevelFilter::Info
|
||||
}
|
||||
}
|
||||
|
||||
const fn version() -> &'static str {
|
||||
match option_env!("BARK_PKG_VERSION") {
|
||||
Some(ver) => ver,
|
||||
None => env!("CARGO_PKG_VERSION"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue