From 3dff147d0ca1a2cd8d264d20a178d71cb38b1c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 14 Jun 2019 19:05:06 +0200 Subject: feat: add deno install command (#2522) --- cli/flags.rs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ cli/main.rs | 1 + 2 files changed, 51 insertions(+) (limited to 'cli') diff --git a/cli/flags.rs b/cli/flags.rs index 8b95aefae..a4cbd2133 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -338,6 +338,29 @@ Demonstrates breaking the input up by space delimiter instead of by lines: .help("Set delimiter, defaults to newline") .takes_value(true), ).arg(Arg::with_name("code").takes_value(true).required(true)), + ).subcommand( + SubCommand::with_name("install") + .settings(&[ + AppSettings::DisableVersion, + AppSettings::DisableHelpSubcommand, + AppSettings::AllowExternalSubcommands, + AppSettings::SubcommandRequired, + ]) + .about("Install script as executable") + .long_about( +"Automatically downloads deno_installer dependencies on first run. + + deno install file_server https://deno.land/std/http/file_server.ts --allow-net --allow-read", + ).arg( + Arg::with_name("exe_name") + .help("Executable name") + .required(true), + ).subcommand( + // this is a fake subcommand - it's used in conjunction with + // AppSettings:AllowExternalSubcommand to treat it as an + // entry point script + SubCommand::with_name("