| 602 | } |
| 603 | |
| 604 | fn gateway_env_override_warning(selected_name: &str) -> Option<String> { |
| 605 | let env_name = std::env::var("OPENSHELL_GATEWAY").ok()?; |
| 606 | if env_name.is_empty() || env_name == selected_name { |
| 607 | return None; |
| 608 | } |
| 609 | |
| 610 | Some(format!( |
| 611 | "OPENSHELL_GATEWAY={env_name} is set and will override this selection.\n Unset it or run: export OPENSHELL_GATEWAY={selected_name}" |
| 612 | )) |
| 613 | } |
| 614 | |
| 615 | pub fn gateway_select(name: Option<&str>, gateway_flag: &Option<String>) -> Result<()> { |
| 616 | let interactive = std::io::stdin().is_terminal() && std::io::stdout().is_terminal(); |