summaryrefslogtreecommitdiff
path: root/cli/args/flags.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r--cli/args/flags.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index bd6b30e41..39db12b5f 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -1939,6 +1939,7 @@ On the first invocation with deno will download the proper binary and cache it i
])
.help_heading(COMPILE_HEADING),
)
+ .arg(no_code_cache_arg())
.arg(
Arg::new("no-terminal")
.long("no-terminal")
@@ -4431,6 +4432,8 @@ fn compile_parse(
};
ext_arg_parse(flags, matches);
+ flags.code_cache_enabled = !matches.get_flag("no-code-cache");
+
flags.subcommand = DenoSubcommand::Compile(CompileFlags {
source_file,
output,
@@ -10040,6 +10043,7 @@ mod tests {
include: vec![]
}),
type_check_mode: TypeCheckMode::Local,
+ code_cache_enabled: true,
..Flags::default()
}
);
@@ -10048,7 +10052,7 @@ mod tests {
#[test]
fn compile_with_flags() {
#[rustfmt::skip]
- let r = flags_from_vec(svec!["deno", "compile", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--no-terminal", "--icon", "favicon.ico", "--output", "colors", "--env=.example.env", "https://examples.deno.land/color-logging.ts", "foo", "bar", "-p", "8080"]);
+ let r = flags_from_vec(svec!["deno", "compile", "--import-map", "import_map.json", "--no-code-cache", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--no-terminal", "--icon", "favicon.ico", "--output", "colors", "--env=.example.env", "https://examples.deno.land/color-logging.ts", "foo", "bar", "-p", "8080"]);
assert_eq!(
r.unwrap(),
Flags {
@@ -10064,6 +10068,7 @@ mod tests {
}),
import_map_path: Some("import_map.json".to_string()),
no_remote: true,
+ code_cache_enabled: false,
config_flag: ConfigFlag::Path("tsconfig.json".to_owned()),
type_check_mode: TypeCheckMode::None,
reload: true,