diff options
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![], |