summaryrefslogtreecommitdiff
path: root/cli/args/flags.rs
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2023-10-20 13:02:08 +0900
committerGitHub <noreply@github.com>2023-10-20 13:02:08 +0900
commitfb73eb1e9dca3e93cc7efcf5c2244e0068733843 (patch)
treeef0d50f6a4f3ff14114cc4a5c544bb7f4dfd2cdf /cli/args/flags.rs
parent8d9fef3b8955eadfd4820455b422b5bec1cdad0a (diff)
feat(unstable): allow bare specifier for builtin node module (#20728)
closes #20566
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r--cli/args/flags.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index 66981b239..138d77359 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -1,5 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+use clap::builder::FalseyValueParser;
use clap::value_parser;
use clap::Arg;
use clap::ArgAction;
@@ -405,6 +406,7 @@ pub struct Flags {
pub reload: bool,
pub seed: Option<u64>,
pub unstable: bool,
+ pub unstable_bare_node_builtlins: bool,
pub unsafely_ignore_certificate_errors: Option<Vec<String>>,
pub v8_flags: Vec<String>,
}
@@ -801,6 +803,10 @@ pub fn flags_from_vec(args: Vec<String>) -> clap::error::Result<Flags> {
flags.unstable = true;
}
+ if matches.get_flag("unstable-bare-node-builtins") {
+ flags.unstable_bare_node_builtlins = true;
+ }
+
if matches.get_flag("quiet") {
flags.log_level = Some(Level::Error);
} else if let Some(log_level) = matches.get_one::<String>("log-level") {
@@ -897,6 +903,15 @@ fn clap_root() -> Command {
.global(true),
)
.arg(
+ Arg::new("unstable-bare-node-builtins")
+ .long("unstable-bare-node-builtins")
+ .help("Enable unstable bare node builtins feature")
+ .env("DENO_UNSTABLE_BARE_NODE_BUILTINS")
+ .value_parser(FalseyValueParser::new())
+ .action(ArgAction::SetTrue)
+ .global(true),
+ )
+ .arg(
Arg::new("log-level")
.short('L')
.long("log-level")