diff options
author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2023-03-26 16:55:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-26 14:55:58 +0000 |
commit | a29d88b43bdc3bf08a30fdb64d35beef8839f246 (patch) | |
tree | 89ca27e21576f410a7b980ddb04c48e63a9bc24d /cli/args/flags.rs | |
parent | 701099b2a9ec64e6fad3b7ecfd78e8c7224ef83e (diff) |
feat(bench): add `--no-run` flag (#18433)
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index dd2a40913..7d124a6c1 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -60,6 +60,7 @@ pub struct BenchFlags { pub files: FileFlags, pub filter: Option<String>, pub json: bool, + pub no_run: bool, } #[derive(Clone, Debug, Eq, PartialEq)] @@ -804,6 +805,12 @@ fn bench_subcommand() -> Command { .value_parser(value_parser!(PathBuf)) .action(ArgAction::Append), ) + .arg( + Arg::new("no-run") + .long("no-run") + .help("Cache bench modules, but don't run benchmarks") + .action(ArgAction::SetTrue), + ) .arg(watch_arg(false)) .arg(no_clear_screen_arg()) .arg(script_arg().last(true)) @@ -2368,11 +2375,14 @@ fn bench_parse(flags: &mut Flags, matches: &mut ArgMatches) { Vec::new() }; + let no_run = matches.get_flag("no-run"); + watch_arg_parse(flags, matches, false); flags.subcommand = DenoSubcommand::Bench(BenchFlags { files: FileFlags { include, ignore }, filter, json, + no_run, }); } @@ -6482,6 +6492,7 @@ mod tests { "--unstable", "--no-npm", "--no-remote", + "--no-run", "--filter", "- foo", "--location", @@ -6499,6 +6510,7 @@ mod tests { subcommand: DenoSubcommand::Bench(BenchFlags { filter: Some("- foo".to_string()), json: true, + no_run: true, files: FileFlags { include: vec![PathBuf::from("dir1/"), PathBuf::from("dir2/")], ignore: vec![], @@ -6526,6 +6538,7 @@ mod tests { subcommand: DenoSubcommand::Bench(BenchFlags { filter: None, json: false, + no_run: false, files: FileFlags { include: vec![], ignore: vec![], |