Skip to content

Commit

Permalink
feat: Print hugr-cli's correct version when using '--version' (#1790)
Browse files Browse the repository at this point in the history
```
$ cargo run -- --version
hugr-cli 0.14.0
```
  • Loading branch information
aborgna-q authored Dec 17, 2024
1 parent 1d11d3c commit 66745bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hugr-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ categories = ["compilers"]
bench = false

[dependencies]
clap = { workspace = true, features = ["derive"] }
clap = { workspace = true, features = ["derive", "cargo"] }
clap-verbosity-flag.workspace = true
derive_more = { workspace = true, features = ["display", "error", "from"] }
hugr = { path = "../hugr", version = "0.14.0" }
Expand Down
4 changes: 2 additions & 2 deletions hugr-cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Standard command line tools, used by the hugr binary.
use clap::Parser;
use clap::{crate_version, Parser};
use clap_verbosity_flag::{InfoLevel, Verbosity};
use clio::Input;
use derive_more::{Display, Error, From};
Expand All @@ -18,7 +18,7 @@ use hugr::package::Package;

/// CLI arguments.
#[derive(Parser, Debug)]
#[clap(version = "1.0", long_about = None)]
#[clap(version = crate_version!(), long_about = None)]
#[clap(about = "HUGR CLI tools.")]
#[group(id = "hugr")]
#[non_exhaustive]
Expand Down

0 comments on commit 66745bf

Please sign in to comment.