summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/flags.rs16
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!(