MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / confirm_global_setting_takeover

Function confirm_global_setting_takeover

crates/openshell-cli/src/run.rs:6159–6183  ·  view source on GitHub ↗
(key: &str, yes: bool)

Source from the content-addressed store, hash-verified

6157}
6158
6159fn confirm_global_setting_takeover(key: &str, yes: bool) -> Result<()> {
6160 if yes {
6161 return Ok(());
6162 }
6163
6164 if !std::io::stdin().is_terminal() || !std::io::stdout().is_terminal() {
6165 return Err(miette::miette!(
6166 "global setting updates require confirmation; pass --yes in non-interactive mode"
6167 ));
6168 }
6169
6170 let proceed = Confirm::with_theme(&ColorfulTheme::default())
6171 .with_prompt(format!(
6172 "Setting '{key}' globally will disable sandbox-level management for this key. Continue?"
6173 ))
6174 .default(false)
6175 .interact()
6176 .into_diagnostic()?;
6177
6178 if !proceed {
6179 return Err(miette::miette!("aborted by user"));
6180 }
6181
6182 Ok(())
6183}
6184
6185fn confirm_global_setting_delete(key: &str, yes: bool) -> Result<()> {
6186 if yes {

Callers 2

gateway_setting_setFunction · 0.85

Calls 1

defaultMethod · 0.45

Tested by

no test coverage detected