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

Function run

crates/openshell-supervisor-process/src/debug_rpc.rs:31–50  ·  view source on GitHub ↗

Entry point for the `debug-rpc` subcommand. Returns the process exit code; `main` propagates it.

(args: &[String])

Source from the content-addressed store, hash-verified

29/// Entry point for the `debug-rpc` subcommand. Returns the process exit
30/// code; `main` propagates it.
31pub 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
52const USAGE: &str = "\
53usage: openshell-sandbox debug-rpc <command> [options]

Callers

nothing calls this directly

Calls 4

run_get_sandbox_configFunction · 0.85
run_refreshFunction · 0.85
run_show_tokenFunction · 0.85
run_show_principalFunction · 0.85

Tested by

no test coverage detected