From 0e8ffdf4255addc4d16136bb5c1c849686791d1d Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 13 Jun 2022 21:51:16 +0000 Subject: [PATCH] Fix clap for CI (#5005) # Objective - Fix CI - relevant clap issue https://github.com/clap-rs/clap/issues/3822 ## Solution - slap `value_parser` on all the clap derives. This tells clap to use the default parser for the type. --- tools/build-wasm-example/src/main.rs | 7 ++++--- tools/spancmp/src/main.rs | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/build-wasm-example/src/main.rs b/tools/build-wasm-example/src/main.rs index 8d89f817c4728..a86e7c8872c48 100644 --- a/tools/build-wasm-example/src/main.rs +++ b/tools/build-wasm-example/src/main.rs @@ -6,17 +6,18 @@ use xshell::{cmd, Shell}; #[derive(Parser, Debug)] struct Args { /// Examples to build + #[clap(value_parser)] examples: Vec, - #[clap(short, long)] + #[clap(short, long, value_parser)] /// Run tests test: bool, - #[clap(short, long)] + #[clap(short, long, value_parser)] /// Run on the given browsers. By default, chromium, firefox, webkit browsers: Vec, - #[clap(short, long)] + #[clap(short, long, value_parser)] /// Stop after this number of frames frames: Option, } diff --git a/tools/spancmp/src/main.rs b/tools/spancmp/src/main.rs index a106a40b38c4e..540c50f1b1bdd 100644 --- a/tools/spancmp/src/main.rs +++ b/tools/spancmp/src/main.rs @@ -15,20 +15,22 @@ mod pretty; #[derive(Parser, Debug)] struct Args { - #[clap(short, long, default_value_t = 0.0)] + #[clap(short, long, value_parser, default_value_t = 0.0)] /// Filter spans that have an average shorther than the threshold threshold: f32, - #[clap(short, long)] + #[clap(short, long, value_parser)] /// Filter spans by name matching the pattern pattern: Option, - #[clap(short, long)] + #[clap(short, long, value_parser)] /// Simplify system names short: bool, + #[clap(value_parser)] trace: String, /// Optional, second trace to compare + #[clap(value_parser)] second_trace: Option, }