summaryrefslogtreecommitdiff
path: root/cli/flags.rs
diff options
context:
space:
mode:
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(),