| 40 | } |
| 41 | |
| 42 | pub fn clear_database() -> Arg { |
| 43 | Arg::new("clear-database") |
| 44 | .long("delete-data") |
| 45 | .alias("clear-database") |
| 46 | .short('c') |
| 47 | .num_args(0..=1) |
| 48 | .value_parser(value_parser!(ClearMode)) |
| 49 | // Because we have a default value for this flag, invocations can be ambiguous between |
| 50 | //passing a value to this flag, vs using the default value and passing an anonymous arg |
| 51 | // to the rest of the command. Adding `require_equals` resolves this ambiguity. |
| 52 | .require_equals(true) |
| 53 | .default_missing_value("always") |
| 54 | .help( |
| 55 | "When publishing to an existing database identity, first DESTROY all data associated with the module. With 'on-conflict': only when breaking schema changes occur." |
| 56 | ) |
| 57 | } |