mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
feat: deno info --reload (#7009)
This commit is contained in:
parent
91ff91093d
commit
fed70c9903
1 changed files with 16 additions and 0 deletions
16
cli/flags.rs
16
cli/flags.rs
|
@ -465,6 +465,7 @@ fn eval_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
|
|||
}
|
||||
|
||||
fn info_parse(flags: &mut Flags, matches: &clap::ArgMatches) {
|
||||
reload_arg_parse(flags, matches);
|
||||
ca_file_arg_parse(flags, matches);
|
||||
unstable_arg_parse(flags, matches);
|
||||
let json = matches.is_present("json");
|
||||
|
@ -848,6 +849,7 @@ Remote modules cache: Subdirectory containing downloaded remote modules.
|
|||
TypeScript compiler cache: Subdirectory containing TS compiler output.",
|
||||
)
|
||||
.arg(Arg::with_name("file").takes_value(true).required(false))
|
||||
.arg(reload_arg().requires("file"))
|
||||
.arg(ca_file_arg())
|
||||
// TODO(nayeemrmn): `--no-check` has been removed for `deno info`, but it
|
||||
// shouldn't cause flag parsing to fail for backward-compatibility. Remove
|
||||
|
@ -1840,6 +1842,20 @@ mod tests {
|
|||
}
|
||||
);
|
||||
|
||||
let r = flags_from_vec_safe(svec!["deno", "info", "--reload", "script.ts"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
Flags {
|
||||
subcommand: DenoSubcommand::Info {
|
||||
json: false,
|
||||
file: Some("script.ts".to_string()),
|
||||
},
|
||||
reload: true,
|
||||
no_check: true,
|
||||
..Flags::default()
|
||||
}
|
||||
);
|
||||
|
||||
let r = flags_from_vec_safe(svec!["deno", "info", "--json", "script.ts"]);
|
||||
assert_eq!(
|
||||
r.unwrap(),
|
||||
|
|
Loading…
Reference in a new issue