summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-09-08 12:14:59 -0500
committerGitHub <noreply@github.com>2023-09-08 17:14:59 +0000
commit9cac5601b8f37ba4713631a13cf1ed65c82012c9 (patch)
tree3b2cd2bfe3cc5e44a38608ad775bfef8e1af1e8a
parent1b7d5937d94da0e05ac9108c3e1544d6791b2fc9 (diff)
fix(compile): support providing flags as args (#20422)
Closes #20413
-rw-r--r--cli/args/flags.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index 773c95fec..c09d4e7e9 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -1111,7 +1111,6 @@ supported in canary.
)
.defer(|cmd| {
runtime_args(cmd, true, false)
- .arg(script_arg().required(true))
.arg(check_arg(true))
.arg(
Arg::new("include")
@@ -1152,6 +1151,7 @@ supported in canary.
.action(ArgAction::SetTrue),
)
.arg(executable_ext_arg())
+ .arg(script_arg().required(true).trailing_var_arg(true))
})
}
@@ -7262,14 +7262,14 @@ 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", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--no-terminal", "--output", "colors", "https://deno.land/std/examples/colors.ts", "foo", "bar"]);
+ 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", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--no-terminal", "--output", "colors", "https://deno.land/std/examples/colors.ts", "foo", "bar", "-p", "8080"]);
assert_eq!(
r.unwrap(),
Flags {
subcommand: DenoSubcommand::Compile(CompileFlags {
source_file: "https://deno.land/std/examples/colors.ts".to_string(),
output: Some(PathBuf::from("colors")),
- args: svec!["foo", "bar"],
+ args: svec!["foo", "bar", "-p", "8080"],
target: None,
no_terminal: true,
include: vec![]