Entry point for the `debug-rpc` subcommand. Returns the process exit code; `main` propagates it.
(args: &[String])
| 29 | /// Entry point for the `debug-rpc` subcommand. Returns the process exit |
| 30 | /// code; `main` propagates it. |
| 31 | pub async fn run(args: &[String]) -> Result<i32> { |
| 32 | let cmd = args |
| 33 | .first() |
| 34 | .map(String::as_str) |
| 35 | .ok_or_else(|| miette::miette!("{}", USAGE))?; |
| 36 | |
| 37 | match cmd { |
| 38 | "get-sandbox-config" => run_get_sandbox_config(&args[1..]).await, |
| 39 | "refresh" => run_refresh().await, |
| 40 | "show-token" => run_show_token(), |
| 41 | "show-principal" => run_show_principal(), |
| 42 | "--help" | "-h" => { |
| 43 | println!("{USAGE}"); |
| 44 | Ok(0) |
| 45 | } |
| 46 | other => Err(miette::miette!( |
| 47 | "unknown debug-rpc command '{other}'\n\n{USAGE}" |
| 48 | )), |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | const USAGE: &str = "\ |
| 53 | usage: openshell-sandbox debug-rpc <command> [options] |
nothing calls this directly
no test coverage detected