From fed70c9903e616702241725e82a7d633f2a9b05d Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 12 Aug 2020 11:58:50 +0100 Subject: feat: deno info --reload (#7009) --- cli/flags.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cli') diff --git a/cli/flags.rs b/cli/flags.rs index ee85efbe9..993f681b5 100644 --- a/cli/flags.rs +++ b/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(), -- cgit v1.2.3