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:
parent
ef26a267ae
commit
7f520e7206
1 changed files with 16 additions and 0 deletions
16
cli/flags.rs
16
cli/flags.rs
|
@ -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"]);
|
||||||
|
|
Loading…
Reference in a new issue