| 13 | use tokio::io::AsyncWriteExt as _; |
| 14 | |
| 15 | pub fn cli() -> clap::Command { |
| 16 | clap::Command::new("delete") |
| 17 | .about("Deletes a SpacetimeDB database") |
| 18 | .arg( |
| 19 | Arg::new("database") |
| 20 | .required(false) |
| 21 | .help("The name or identity of the database to delete"), |
| 22 | ) |
| 23 | .arg(common_args::server().help("The nickname, host name or URL of the server hosting the database")) |
| 24 | .arg(common_args::yes()) |
| 25 | .arg( |
| 26 | Arg::new("no_config") |
| 27 | .long("no-config") |
| 28 | .action(clap::ArgAction::SetTrue) |
| 29 | .help("Ignore spacetime.json configuration"), |
| 30 | ) |
| 31 | .after_help("Run `spacetime help delete` for more detailed information.\n") |
| 32 | } |
| 33 | |
| 34 | pub async fn exec(mut config: Config, args: &ArgMatches) -> Result<(), anyhow::Error> { |
| 35 | let server_from_cli = args.get_one::<String>("server").map(|s| s.as_ref()); |