Skip to content

Commit

Permalink
Enable --help messages and accept --include-ignored as no-op (#703)
Browse files Browse the repository at this point in the history
* Enable `--help` for CLI

Since clap 4, it requires the `help` feature to work.

* Accept `--include-ignored` for compatibility

This is a popular libtest parameter in CI to run all tests including
non-ignored and ignored ones. In our case, we have no "ignored"
semantics, thus it should be a no-op.
  • Loading branch information
oxalica committed Aug 10, 2023
1 parent 1b7ca52 commit 928d8a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ serde_json = "1.0"
serde_derive = "1.0"
ciborium = "0.2.0"
is-terminal = "0.4.6"
clap = { version = "4", default-features = false, features = ["std"] }
clap = { version = "4", default-features = false, features = ["std", "help"] }
walkdir = "2.3"
tinytemplate = "1.1"
cast = "0.3"
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,11 @@ impl<M: Measurement> Criterion<M> {
.num_args(0)
.hide(true)
.help("Ignored, but added for compatibility with libtest."))
.arg(Arg::new("include-ignored")
.long("include-ignored")
.num_args(0)
.hide(true)
.help("Ignored, but added for compatibility with libtest."))
.arg(Arg::new("version")
.hide(true)
.short('V')
Expand Down

0 comments on commit 928d8a9

Please sign in to comment.