1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

fix(task): allow hyphen values after task name (#14434)

This commit is contained in:
David Sherret 2022-04-29 10:29:14 -04:00 committed by GitHub
parent ef26a267ae
commit 7f520e7206
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1434,6 +1434,7 @@ fn task_subcommand<'a>() -> Command<'a> {
Arg::new("task_args") Arg::new("task_args")
.multiple_values(true) .multiple_values(true)
.multiple_occurrences(true) .multiple_occurrences(true)
.allow_hyphen_values(true)
.help("Additional arguments passed to the task"), .help("Additional arguments passed to the task"),
) )
.about("Run a task defined in the configuration file") .about("Run a task defined in the configuration file")
@ -5544,6 +5545,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] #[test]
fn task_subcommand_empty() { fn task_subcommand_empty() {
let r = flags_from_vec(svec!["deno", "task"]); let r = flags_from_vec(svec!["deno", "task"]);