mirror of
https://github.com/denoland/deno
synced 2024-10-05 15:49:20 +00:00
fix(cli): uninstall command accept short flags (#17259)
This commit is contained in:
parent
896dd56b7a
commit
39cbaa6d34
|
@ -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…
Reference in a new issue