Allow multiple CLI flag occurrences
After having created a .cargo/config file with `fargo write-config`,
some arguments may be provided multiple times.
Change-Id: I350ee4528951a6fffda3108c92ce8d02b9fa9b29
Reviewed-on: https://fuchsia-review.googlesource.com/c/fargo/+/384538
Reviewed-by: Rob Tsuk <robtsuk@google.com>
diff --git a/src/command_line.rs b/src/command_line.rs
index d2d05c1..291e198 100644
--- a/src/command_line.rs
+++ b/src/command_line.rs
@@ -225,7 +225,10 @@
binary_to_run: Option<String>,
/// Use run to run the binary.
- #[structopt(long)]
+ // Allow multiple occurences since fargo writes out a .cargo/config runner
+ // command that includes "--run-with-run", but some fargo commands also
+ // append their own "--run-with-run" when calling fargo recursively.
+ #[structopt(long, multiple = true)]
run_with_run: bool,
/// Use tiles_ctl add to run the binary.
@@ -260,7 +263,10 @@
runner_args: Vec<String>,
/// Display all output when running tests.
- #[structopt(long)]
+ // Allow multiple occurences since fargo writes out a .cargo/config runner
+ // command that includes "--nocapture", but some tools like VSCode additionally
+ // append their own "--nocapture" when running.
+ #[structopt(long, multiple = true)]
nocapture: bool,
}
@@ -303,7 +309,10 @@
test: Option<String>,
/// Display all output when running tests.
- #[structopt(long)]
+ // Allow multiple occurences since fargo writes out a .cargo/config runner
+ // command that includes "--nocapture", but some tools like VSCode additionally
+ // append their own "--nocapture" when running.
+ #[structopt(long, multiple = true)]
nocapture: bool,
/// Name of the bin target to test.