diff --git a/CHANGELOG.md b/CHANGELOG.md index f1c6be9b..05d0457f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ All notable changes to insta and cargo-insta are documented here. - Mark `require-full-match` as experimental, given some corner-cases are currently difficult to manage. #497 +- `cargo insta test` now accepts multiple `--exclude` flags. #520 + ## 1.39.0 - Fixed a bug in `require_full_match`. #485 diff --git a/cargo-insta/src/cli.rs b/cargo-insta/src/cli.rs index db47ed09..23f2b203 100644 --- a/cargo-insta/src/cli.rs +++ b/cargo-insta/src/cli.rs @@ -137,7 +137,7 @@ struct TestCommand { package: Vec, /// Exclude packages from the test #[structopt(long, value_name = "SPEC")] - exclude: Option, + exclude: Vec, /// Disable force-passing of snapshot tests #[structopt(long)] no_force_pass: bool, @@ -866,7 +866,7 @@ fn prepare_test_runner<'snapshot_ref>( proc.arg("--package"); proc.arg(pkg); } - if let Some(ref spec) = cmd.exclude { + for spec in &cmd.exclude { proc.arg("--exclude"); proc.arg(spec); }