diff options
Diffstat (limited to 'cli/flags.rs')
-rw-r--r-- | cli/flags.rs | 57 |
1 files changed, 2 insertions, 55 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index f6cebae46..8c2400057 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -476,7 +476,7 @@ fn info_parse(flags: &mut Flags, matches: &clap::ArgMatches) { ca_file_arg_parse(flags, matches); unstable_arg_parse(flags, matches); let json = matches.is_present("json"); - flags.no_check = true; + no_check_arg_parse(flags, matches); flags.subcommand = DenoSubcommand::Info { file: matches.value_of("file").map(|f| f.to_string()), json, @@ -870,10 +870,7 @@ 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 - // this line for v2.0.0. - .arg(no_check_arg().hidden(true)) + .arg(no_check_arg()) .arg(unstable_arg()) .arg( Arg::with_name("json") @@ -1907,7 +1904,6 @@ mod tests { json: false, file: Some("script.ts".to_string()), }, - no_check: true, ..Flags::default() } ); @@ -1921,7 +1917,6 @@ mod tests { file: Some("script.ts".to_string()), }, reload: true, - no_check: true, ..Flags::default() } ); @@ -1934,7 +1929,6 @@ mod tests { json: true, file: Some("script.ts".to_string()), }, - no_check: true, ..Flags::default() } ); @@ -1947,7 +1941,6 @@ mod tests { json: false, file: None }, - no_check: true, ..Flags::default() } ); @@ -1960,7 +1953,6 @@ mod tests { json: true, file: None }, - no_check: true, ..Flags::default() } ); @@ -2683,50 +2675,6 @@ mod tests { ..Flags::default() } ); - let r = - flags_from_vec_safe(svec!["deno", "test", "--no-check", "script.ts"]); - assert_eq!( - r.unwrap(), - Flags { - subcommand: DenoSubcommand::Test { - fail_fast: false, - filter: None, - allow_none: false, - quiet: false, - include: Some(svec!["script.ts"]), - }, - no_check: true, - ..Flags::default() - } - ); - let r = - flags_from_vec_safe(svec!["deno", "cache", "--no-check", "script.ts"]); - assert_eq!( - r.unwrap(), - Flags { - subcommand: DenoSubcommand::Cache { - files: svec!["script.ts"], - }, - no_check: true, - ..Flags::default() - } - ); - // TODO(nayeemrmn): `--no-check` has been removed for `deno info`, but it - // shouldn't cause flag parsing to fail for backward-compatibility. Remove - // this test for v2.0.0. - let r = - flags_from_vec_safe(svec!["deno", "info", "--no-check", "script.ts"]); - assert_eq!( - r.unwrap(), - Flags { - subcommand: DenoSubcommand::Info { - json: false, - file: Some("script.ts".to_string()), - }, - no_check: true, - ..Flags::default() - } - ); } #[test] @@ -3066,7 +3014,6 @@ mod tests { file: Some("https://example.com".to_string()), }, ca_file: Some("example.crt".to_owned()), - no_check: true, ..Flags::default() } ); |