mirror of
https://github.com/denoland/deno.git
synced 2025-02-20 12:22:52 -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(
|
||||||
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…
Add table
Reference in a new issue