mirror of
https://github.com/denoland/deno.git
synced 2025-02-18 19:33:00 -05:00
fix(cli): uninstall command accept short flags (#17259)
This commit is contained in:
parent
b72d244bbd
commit
c56477654f
1 changed files with 22 additions and 2 deletions
|
@ -1312,8 +1312,7 @@ fn uninstall_subcommand<'a>() -> Command<'a> {
|
|||
.arg(
|
||||
Arg::new("name")
|
||||
.required(true)
|
||||
.multiple_occurrences(false)
|
||||
.allow_hyphen_values(true))
|
||||
.multiple_occurrences(false))
|
||||
.arg(
|
||||
Arg::new("root")
|
||||
.long("root")
|
||||
|
@ -5004,6 +5003,27 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn uninstall() {
|
||||
let r = flags_from_vec(svec!["deno", "uninstall", "file_server"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
subcommand: DenoSubcommand::Uninstall(UninstallFlags {
|
||||
name: "file_server".to_string(),
|
||||
root: None,
|
||||
}),
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn uninstall_with_help_flag() {
|
||||
let r = flags_from_vec(svec!["deno", "uninstall", "--help"]);
|
||||
assert_eq!(r.err().unwrap().kind(), clap::ErrorKind::DisplayHelp);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn log_level() {
|
||||
let r =
|
||||
|
|
Loading…
Add table
Reference in a new issue