(
config: Config,
paths: &SpacetimePaths,
root_dir: Option<&RootDir>,
cmd: &str,
args: &ArgMatches,
)
| 45 | } |
| 46 | |
| 47 | pub 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`. |
no test coverage detected
searching dependent graphs…