diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-30 09:19:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-30 09:19:24 -0400 |
commit | c8f692057b256dac57342867b7606a74309449fc (patch) | |
tree | 7013cefaab540a35cc25ba0c6087655b420a2425 /cli/args | |
parent | efb413bdaa0f5be6d9082d397aae1e20a258c85f (diff) |
refactor: bury descriptor parsing in PermissionsContainer (#25936)
Closes https://github.com/denoland/deno/issues/25634
Diffstat (limited to 'cli/args')
-rw-r--r-- | cli/args/flags.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 13c93fa83..2cbf46394 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -34,8 +34,8 @@ use deno_core::url::Url; use deno_graph::GraphKind; use deno_path_util::normalize_path; use deno_path_util::url_to_file_path; -use deno_runtime::deno_permissions::parse_sys_kind; use deno_runtime::deno_permissions::PermissionsOptions; +use deno_runtime::deno_permissions::SysDescriptor; use log::debug; use log::Level; use serde::Deserialize; @@ -3448,7 +3448,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { .require_equals(true) .value_name("API_NAME") .help("Allow access to OS information. Optionally allow specific APIs by function name") - .value_parser(|key: &str| parse_sys_kind(key).map(ToString::to_string)) + .value_parser(|key: &str| SysDescriptor::parse(key.to_string()).map(|s| s.into_string())) .hide(true) ; if let Some(requires) = requires { @@ -3466,7 +3466,7 @@ fn permission_args(app: Command, requires: Option<&'static str>) -> Command { .require_equals(true) .value_name("API_NAME") .help("Deny access to OS information. Optionally deny specific APIs by function name") - .value_parser(|key: &str| parse_sys_kind(key).map(ToString::to_string)) + .value_parser(|key: &str| SysDescriptor::parse(key.to_string()).map(|s| s.into_string())) .hide(true) ; if let Some(requires) = requires { |