Skip to content

Commit d4799d3

Browse files
committed
sim-rs: add --version command
1 parent 245de56 commit d4799d3

File tree

4 files changed

+198
-5
lines changed

4 files changed

+198
-5
lines changed

sim-rs/Cargo.lock

Lines changed: 184 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sim-rs/sim-cli/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ minicbor-serde = { version = "0.4", features = ["alloc"] }
1717
netsim-core = { git = "https://github.com/input-output-hk/ce-netsim", rev = "9d1e26c" }
1818
pretty-bytes-rust = "0.3.0"
1919
rand = "0.9"
20-
statrs = "0.18"
2120
serde = { version = "1", features = ["derive"] }
2221
serde_json = "1"
2322
serde_yaml = "0.9"
2423
sim-core = { path = "../sim-core" }
24+
statrs = "0.18"
2525
tokio = { version = "1", features = ["full"] }
2626
tokio-util = "0.7"
2727
toml = "0.8"
2828
tracing = "0.1"
2929
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
30+
31+
[build-dependencies]
32+
vergen-gitcl = { version = "1", features = ["build"] }

sim-rs/sim-cli/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use std::error::Error;
2+
3+
use vergen_gitcl::{Emitter, GitclBuilder};
4+
5+
fn main() -> Result<(), Box<dyn Error>> {
6+
let git = GitclBuilder::default().sha(true).build()?;
7+
Emitter::default().add_instructions(&git)?.emit()?;
8+
Ok(())
9+
}

sim-rs/sim-cli/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const DEFAULT_TOPOLOGY_PATHS: &[&str] = &[
3232
];
3333

3434
#[derive(Parser)]
35+
#[command(version = env!("VERGEN_GIT_SHA"))]
3536
struct Args {
3637
#[clap(default_value = None)]
3738
topology: Option<PathBuf>,

0 commit comments

Comments
 (0)