diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-04-25 20:59:49 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-25 12:59:49 -0600 |
commit | aa85a4d2884e7600e0f64c457e20cd7f02b811c6 (patch) | |
tree | c451ab9fec8d551b3b6c087a1febd7f8ce90bc2b /cli/flags.rs | |
parent | b426ecce80a968ae77cde9e242a9014bff371f79 (diff) |
Rename CLI flags to subcommands (#2212)
Diffstat (limited to 'cli/flags.rs')
-rw-r--r-- | cli/flags.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index 00b94f811..76dbae30b 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -34,14 +34,9 @@ pub fn create_cli_app<'a, 'b>() -> App<'a, 'b> { .global_settings(&[AppSettings::ColorNever]) .settings(&[ AppSettings::AllowExternalSubcommands, - AppSettings::DisableHelpSubcommand, + AppSettings::DisableVersion, ]).after_help(ENV_VARIABLES_HELP) .arg( - Arg::with_name("version") - .short("v") - .long("version") - .help("Print the version"), - ).arg( Arg::with_name("allow-read") .long("allow-read") .help("Allow file system read access"), @@ -95,7 +90,8 @@ pub fn create_cli_app<'a, 'b>() -> App<'a, 'b> { .use_delimiter(true) .require_equals(true) .help("Set V8 command line options"), - ).subcommand( + ).subcommand(SubCommand::with_name("version").about("Print the version")) + .subcommand( SubCommand::with_name("fetch") .setting(AppSettings::DisableVersion) .about("Fetch the dependencies") @@ -205,7 +201,7 @@ mod tests { #[test] fn test_set_flags_1() { - let flags = flags_from_vec(svec!["deno", "--version"]); + let flags = flags_from_vec(svec!["deno", "version"]); assert_eq!( flags, DenoFlags { |