| 189 | } |
| 190 | |
| 191 | pub fn cli() -> clap::Command { |
| 192 | clap::Command::new("publish") |
| 193 | .about("Create and update a SpacetimeDB database") |
| 194 | .arg(common_args::clear_database()) |
| 195 | .arg( |
| 196 | Arg::new("build_options") |
| 197 | .long("build-options") |
| 198 | .alias("build-opts") |
| 199 | .action(Set) |
| 200 | .default_value("") |
| 201 | .help("Options to pass to the build command, for example --build-options='--lint-dir='") |
| 202 | ) |
| 203 | .arg( |
| 204 | Arg::new("module_path") |
| 205 | .value_parser(clap::value_parser!(PathBuf)) |
| 206 | .long("module-path") |
| 207 | .short('p') |
| 208 | .help("The system path (absolute or relative) to the module project. Defaults to spacetimedb/ subdirectory, then current directory.") |
| 209 | ) |
| 210 | .arg( |
| 211 | Arg::new("wasm_file") |
| 212 | .value_parser(clap::value_parser!(PathBuf)) |
| 213 | .long("bin-path") |
| 214 | .short('b') |
| 215 | .conflicts_with("module_path") |
| 216 | .conflicts_with("build_options") |
| 217 | .conflicts_with("js_file") |
| 218 | .help("The system path (absolute or relative) to the compiled wasm binary we should publish, instead of building the project."), |
| 219 | ) |
| 220 | .arg( |
| 221 | Arg::new("js_file") |
| 222 | .value_parser(clap::value_parser!(PathBuf)) |
| 223 | .long("js-path") |
| 224 | .short('j') |
| 225 | .conflicts_with("module_path") |
| 226 | .conflicts_with("build_options") |
| 227 | .conflicts_with("wasm_file") |
| 228 | .help("UNSTABLE: The system path (absolute or relative) to the javascript file we should publish, instead of building the project."), |
| 229 | ) |
| 230 | .arg( |
| 231 | Arg::new("num_replicas") |
| 232 | .value_parser(clap::value_parser!(u8)) |
| 233 | .long("num-replicas") |
| 234 | .hide(true) |
| 235 | .help("UNSTABLE: The number of replicas the database should have") |
| 236 | ) |
| 237 | .arg( |
| 238 | Arg::new("break_clients") |
| 239 | .long("break-clients") |
| 240 | .action(SetTrue) |
| 241 | .help("Allow breaking changes when publishing to an existing database identity. Equivalent to --yes=break-clients: skips the \"this will BREAK existing clients\" prompt, but will NOT force publish if it would cause deletion of any data in the database. See --yes and --delete-data for details.") |
| 242 | ) |
| 243 | .arg( |
| 244 | common_args::anonymous() |
| 245 | ) |
| 246 | .arg( |
| 247 | Arg::new("parent") |
| 248 | .help("Domain or identity of a parent for this database") |