diff options
Diffstat (limited to 'cli/flags.rs')
-rw-r--r-- | cli/flags.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/flags.rs b/cli/flags.rs index eb4bc8641..5feb46371 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -149,7 +149,7 @@ pub struct Flags { pub lock_write: bool, pub log_level: Option<Level>, pub no_check: bool, - pub no_prompts: bool, + pub prompt: bool, pub no_remote: bool, pub reload: bool, pub repl: bool, @@ -244,6 +244,7 @@ impl From<Flags> for PermissionsOptions { allow_read: flags.allow_read, allow_run: flags.allow_run, allow_write: flags.allow_write, + prompt: flags.prompt, } } } @@ -1428,6 +1429,11 @@ fn permission_args<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b> { .long("allow-all") .help("Allow all permissions"), ) + .arg( + Arg::with_name("prompt") + .long("prompt") + .help("Fallback to prompt if required permission wasn't passed"), + ) } fn run_subcommand<'a, 'b>() -> App<'a, 'b> { @@ -1844,6 +1850,9 @@ fn permission_args_parse(flags: &mut Flags, matches: &clap::ArgMatches) { flags.allow_plugin = true; flags.allow_hrtime = true; } + if matches.is_present("prompt") { + flags.prompt = true; + } } // TODO(ry) move this to utility module and add test. |