Remove a local gateway registration without touching the gateway service.
(name: &str)
| 1498 | |
| 1499 | /// Remove a local gateway registration without touching the gateway service. |
| 1500 | pub fn gateway_remove(name: &str) -> Result<()> { |
| 1501 | match gateway_metadata_source(name)? { |
| 1502 | Some(GatewayMetadataSource::User) => {} |
| 1503 | Some(GatewayMetadataSource::System) => { |
| 1504 | return Err(miette::miette!( |
| 1505 | "Gateway registration '{name}' is installed by the system and cannot be removed from user config.\n\ |
| 1506 | Register a per-user gateway with the same name to override it, or select another gateway." |
| 1507 | )); |
| 1508 | } |
| 1509 | None => { |
| 1510 | return Err(miette::miette!( |
| 1511 | "No gateway metadata found for '{name}'.\n\ |
| 1512 | List available gateways: openshell gateway select" |
| 1513 | )); |
| 1514 | } |
| 1515 | } |
| 1516 | |
| 1517 | remove_gateway_registration(name); |
| 1518 | eprintln!( |
| 1519 | "{} Gateway registration '{name}' removed.", |
| 1520 | "✓".green().bold() |
| 1521 | ); |
| 1522 | Ok(()) |
| 1523 | } |
| 1524 | |
| 1525 | /// Show gateway registration details. |
| 1526 | pub fn gateway_admin_info(name: &str) -> Result<()> { |
no test coverage detected