From fb73eb1e9dca3e93cc7efcf5c2244e0068733843 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 20 Oct 2023 13:02:08 +0900 Subject: feat(unstable): allow bare specifier for builtin node module (#20728) closes #20566 --- cli/args/flags.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cli/args/flags.rs') 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, pub unstable: bool, + pub unstable_bare_node_builtlins: bool, pub unsafely_ignore_certificate_errors: Option>, pub v8_flags: Vec, } @@ -801,6 +803,10 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { 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::("log-level") { @@ -896,6 +902,15 @@ fn clap_root() -> Command { .action(ArgAction::SetTrue) .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') -- cgit v1.2.3