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

Function confirm_global_setting_delete

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

Source from the content-addressed store, hash-verified

6183}
6184
6185fn confirm_global_setting_delete(key: &str, yes: bool) -> Result<()> {
6186 if yes {
6187 return Ok(());
6188 }
6189
6190 if !std::io::stdin().is_terminal() || !std::io::stdout().is_terminal() {
6191 return Err(miette::miette!(
6192 "global setting deletes require confirmation; pass --yes in non-interactive mode"
6193 ));
6194 }
6195
6196 let proceed = Confirm::with_theme(&ColorfulTheme::default())
6197 .with_prompt(format!(
6198 "Deleting global setting '{key}' re-enables sandbox-level management for this key. Continue?"
6199 ))
6200 .default(false)
6201 .interact()
6202 .into_diagnostic()?;
6203
6204 if !proceed {
6205 return Err(miette::miette!("aborted by user"));
6206 }
6207
6208 Ok(())
6209}
6210
6211fn parse_cli_setting_value(key: &str, raw_value: &str) -> Result<SettingValue> {
6212 let setting = settings::setting_for_key(key).ok_or_else(|| {

Callers 1

gateway_setting_deleteFunction · 0.85

Calls 1

defaultMethod · 0.45

Tested by

no test coverage detected