From a4ec7dfae01485290af91c62c1ce17a742dcb104 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 25 Nov 2023 11:41:21 -0500 Subject: feat(unstable): --unstable-unsafe-proto (#21313) Closes https://github.com/denoland/deno/issues/21276 --- cli/args/flags.rs | 44 +++++--------------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-) (limited to 'cli/args') diff --git a/cli/args/flags.rs b/cli/args/flags.rs index d1f6c153d..d7d51b374 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -844,45 +844,11 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { if matches.get_flag("unstable") { flags.unstable = true; } - if matches.get_flag("unstable-broadcast-channel") { - flags.unstable_features.push( - deno_runtime::deno_broadcast_channel::UNSTABLE_FEATURE_NAME.to_string(), - ); - } - if matches.get_flag("unstable-ffi") { - flags - .unstable_features - .push(deno_runtime::deno_ffi::UNSTABLE_FEATURE_NAME.to_string()); - } - if matches.get_flag("unstable-fs") { - flags - .unstable_features - .push(deno_runtime::deno_fs::UNSTABLE_FEATURE_NAME.to_string()); - } - if matches.get_flag("unstable-http") { - flags - .unstable_features - .push(deno_runtime::ops::http::UNSTABLE_FEATURE_NAME.to_string()); - } - if matches.get_flag("unstable-kv") { - flags - .unstable_features - .push(deno_runtime::deno_kv::UNSTABLE_FEATURE_NAME.to_string()); - } - if matches.get_flag("unstable-net") { - flags - .unstable_features - .push(deno_runtime::deno_net::UNSTABLE_FEATURE_NAME.to_string()); - } - if matches.get_flag("unstable-worker-options") { - flags - .unstable_features - .push(deno_runtime::ops::worker_host::UNSTABLE_FEATURE_NAME.to_string()); - } - if matches.get_flag("unstable-cron") { - flags - .unstable_features - .push(deno_runtime::deno_cron::UNSTABLE_FEATURE_NAME.to_string()); + + for (name, _, _) in crate::UNSTABLE_GRANULAR_FLAGS { + if matches.get_flag(&format!("unstable-{}", name)) { + flags.unstable_features.push(name.to_string()); + } } flags.unstable_bare_node_builtins = -- cgit v1.2.3