mirror of
https://github.com/denoland/deno
synced 2024-08-24 18:47:06 +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(
|
||||||
Arg::new("name")
|
Arg::new("name")
|
||||||
.required(true)
|
.required(true)
|
||||||
.multiple_occurrences(false)
|
.multiple_occurrences(false))
|
||||||
.allow_hyphen_values(true))
|
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("root")
|
Arg::new("root")
|
||||||
.long("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]
|
#[test]
|
||||||
fn log_level() {
|
fn log_level() {
|
||||||
let r =
|
let r =
|
||||||
|
|
Loading…
Reference in a new issue