summaryrefslogtreecommitdiff
path: root/src/flags.rs
diff options
context:
space:
mode:
authorandy finch <andyfinch7@gmail.com>2019-03-13 12:43:47 -0400
committerRyan Dahl <ry@tinyclouds.org>2019-03-13 12:43:47 -0400
commit7e092210312af337a118c70865c2eb2593c83192 (patch)
tree4af9a6ba35d32e02a5a14224076b446075c3656a /src/flags.rs
parent58cc69f672f91841984fc4e1e9bcfb1a75362677 (diff)
--no-prompt flag for non-interactive environments (#1913)
Diffstat (limited to 'src/flags.rs')
-rw-r--r--src/flags.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/flags.rs b/src/flags.rs
index 471fc58ed..d6a63a9fb 100644
--- a/src/flags.rs
+++ b/src/flags.rs
@@ -22,6 +22,7 @@ pub struct DenoFlags {
pub allow_net: bool,
pub allow_env: bool,
pub allow_run: bool,
+ pub no_prompts: bool,
pub types: bool,
pub prefetch: bool,
pub info: bool,
@@ -108,6 +109,9 @@ fn set_recognized_flags(
flags.allow_read = true;
flags.allow_write = true;
}
+ if matches.opt_present("no-prompt") {
+ flags.no_prompts = true;
+ }
if matches.opt_present("types") {
flags.types = true;
}
@@ -149,6 +153,7 @@ pub fn set_flags(
opts.optflag("", "allow-env", "Allow environment access");
opts.optflag("", "allow-run", "Allow running subprocesses");
opts.optflag("A", "allow-all", "Allow all permissions");
+ opts.optflag("", "no-prompt", "Do not use prompts");
opts.optflag("", "recompile", "Force recompilation of TypeScript code");
opts.optflag("h", "help", "Print this message");
opts.optflag("D", "log-debug", "Log debug output");