summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-08-12 11:58:50 +0100
committerGitHub <noreply@github.com>2020-08-12 12:58:50 +0200
commitfed70c9903e616702241725e82a7d633f2a9b05d (patch)
tree041d507b3ed3ca59f6aade43adc3ec9e0e582243 /cli/flags.rs
parent91ff91093dba45c9696d71e74323487cfa4ce406 (diff)
feat: deno info --reload (#7009)
Diffstat (limited to 'cli/flags.rs')
-rw-r--r--cli/flags.rs16
1 files changed, 16 insertions, 0 deletions
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(),