MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / exec_subcommand

Function exec_subcommand

crates/cli/src/lib.rs:47–78  ·  view source on GitHub ↗
(
    config: Config,
    paths: &SpacetimePaths,
    root_dir: Option<&RootDir>,
    cmd: &str,
    args: &ArgMatches,
)

Source from the content-addressed store, hash-verified

45}
46
47pub async fn exec_subcommand(
48 config: Config,
49 paths: &SpacetimePaths,
50 root_dir: Option<&RootDir>,
51 cmd: &str,
52 args: &ArgMatches,
53) -> anyhow::Result<ExitCode> {
54 match cmd {
55 "call" => call::exec(config, args).await,
56 "describe" => describe::exec(config, args).await,
57 "dev" => dev::exec(config, args).await,
58 "publish" => publish::exec(config, args).await,
59 "delete" => delete::exec(config, args).await,
60 "logs" => logs::exec(config, args).await,
61 "sql" => sql::exec(config, args).await,
62 "rename" => dns::exec(config, args).await,
63 "generate" => generate::exec(config, args).await,
64 "list" => list::exec(config, args).await,
65 "init" => init::exec(config, args).await.map(|_| ()),
66 "build" => build::exec(config, args).await.map(drop),
67 "server" => server::exec(config, paths, args).await,
68 "subscribe" => subscribe::exec(config, args).await,
69 "start" => return start::exec(config, paths, args).await,
70 "login" => login::exec(config, args).await,
71 "logout" => logout::exec(config, args).await,
72 "lock" => lock::exec(config, args).await,
73 "unlock" => unlock::exec(config, args).await,
74 "version" => return subcommands::version::exec(paths, root_dir, args).await,
75 unknown => Err(anyhow::anyhow!("Invalid subcommand: {unknown}")),
76 }
77 .map(|()| ExitCode::SUCCESS)
78}
79
80/// An error type indicating that the process should exit silently with the
81/// given `ExitCode`.

Callers 2

mainFunction · 0.70
invoke_cliFunction · 0.50

Calls 3

execFunction · 0.50
ErrFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…