diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-04-29 10:29:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 10:29:14 -0400 |
commit | 7f520e720680f773d3eb596bf36b1170a9287dc7 (patch) | |
tree | 5159acbd0938dd9b954696605ab0dc536076fb72 | |
parent | ef26a267aebd0f625962f019a7b0f45ae189acb9 (diff) |
fix(task): allow hyphen values after task name (#14434)
-rw-r--r-- | cli/flags.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index 68b960cd4..b827b7d27 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -1434,6 +1434,7 @@ fn task_subcommand<'a>() -> Command<'a> { Arg::new("task_args") .multiple_values(true) .multiple_occurrences(true) + .allow_hyphen_values(true) .help("Additional arguments passed to the task"), ) .about("Run a task defined in the configuration file") @@ -5545,6 +5546,21 @@ mod tests { } #[test] + fn task_following_arg() { + let r = flags_from_vec(svec!["deno", "task", "build", "-1", "--test"]); + assert_eq!( + r.unwrap(), + Flags { + subcommand: DenoSubcommand::Task(TaskFlags { + task: "build".to_string(), + }), + argv: svec!["-1", "--test"], + ..Flags::default() + } + ); + } + + #[test] fn task_subcommand_empty() { let r = flags_from_vec(svec!["deno", "task"]); assert_eq!( |