Skip to content

Commit c7acbf4

Browse files
committed
build(cli): add more metadata to long version
1 parent 84dec98 commit c7acbf4

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,16 @@ rand = { workspace = true }
7171
rattan-core = { path = "rattan-core", features = ["serde"] }
7272
serde = { workspace = true }
7373
serde_json = "1.0.114"
74+
shadow-rs = { version = "1.3.0", default-features = false }
7475
tokio = { workspace = true }
7576
toml = "0.9.2"
7677
tracing = { workspace = true }
7778
tracing-appender = "0.2.3"
7879
tracing-subscriber = { workspace = true }
7980

81+
[build-dependencies]
82+
shadow-rs = "1.3.0"
83+
8084
# required for cargo flamegraph
8185
[profile.release]
8286
debug = true

build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
use shadow_rs::ShadowBuilder;
2+
3+
fn main() {
4+
ShadowBuilder::builder().build().unwrap();
5+
}

src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,22 @@ use tracing::warn;
2424
use tracing_subscriber::Layer;
2525
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
2626

27+
use crate::build::CLAP_LONG_VERSION;
28+
use shadow_rs::shadow;
29+
2730
mod channel;
2831
// mod docker;
2932

3033
// const CONFIG_PORT_BASE: u16 = 8086;
3134

35+
shadow!(build);
36+
3237
static LEFT_PID: OnceCell<i32> = OnceCell::new();
3338
static RIGHT_PID: OnceCell<i32> = OnceCell::new();
3439

3540
#[derive(Debug, Parser, Clone)]
3641
#[command(rename_all = "kebab-case")]
37-
#[command(version, propagate_version = true)]
42+
#[command(version, propagate_version = true, long_version = CLAP_LONG_VERSION)]
3843
pub struct Arguments {
3944
// Verbose debug output
4045
// #[arg(short, long)]

0 commit comments

Comments
 (0)