Skip to content

Commit f208752

Browse files
hymmjames7132
authored andcommitted
Fix clap for CI (bevyengine#5005)
# Objective - Fix CI - relevant clap issue clap-rs/clap#3822 ## Solution - slap `value_parser` on all the clap derives. This tells clap to use the default parser for the type.
1 parent fd6baa2 commit f208752

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

tools/build-wasm-example/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ use xshell::{cmd, Shell};
66
#[derive(Parser, Debug)]
77
struct Args {
88
/// Examples to build
9+
#[clap(value_parser)]
910
examples: Vec<String>,
1011

11-
#[clap(short, long)]
12+
#[clap(short, long, value_parser)]
1213
/// Run tests
1314
test: bool,
1415

15-
#[clap(short, long)]
16+
#[clap(short, long, value_parser)]
1617
/// Run on the given browsers. By default, chromium, firefox, webkit
1718
browsers: Vec<String>,
1819

19-
#[clap(short, long)]
20+
#[clap(short, long, value_parser)]
2021
/// Stop after this number of frames
2122
frames: Option<usize>,
2223
}

tools/spancmp/src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ mod pretty;
1515

1616
#[derive(Parser, Debug)]
1717
struct Args {
18-
#[clap(short, long, default_value_t = 0.0)]
18+
#[clap(short, long, value_parser, default_value_t = 0.0)]
1919
/// Filter spans that have an average shorther than the threshold
2020
threshold: f32,
2121

22-
#[clap(short, long)]
22+
#[clap(short, long, value_parser)]
2323
/// Filter spans by name matching the pattern
2424
pattern: Option<Regex>,
2525

26-
#[clap(short, long)]
26+
#[clap(short, long, value_parser)]
2727
/// Simplify system names
2828
short: bool,
2929

30+
#[clap(value_parser)]
3031
trace: String,
3132
/// Optional, second trace to compare
33+
#[clap(value_parser)]
3234
second_trace: Option<String>,
3335
}
3436

0 commit comments

Comments
 (0)