use clap::{Arg, Command};
pub fn tanzu_subcommands() -> [Command; 2] {
let sds_cmd = sds_group();
let wsr_cmd = wsr_group();
[sds_cmd, wsr_cmd]
}
fn wsr_group() -> Command {
Command::new("wsr")
.long_about("Warm Standby Replication (WSR) operations")
.subcommands(wsr_subcommands())
}
fn sds_group() -> Command {
Command::new("sds")
.long_about("Schema Definition Sync (SDS) operations")
.subcommands(sds_subcommands())
}
fn sds_subcommands() -> [Command; 5] {
let status_cmd = Command::new("status_on_node")
.long_about("Reports Schema Definition Sync (SDS) status on the given node")
.arg(Arg::new("node").short('n').long("node").required(false));
let disable_on_node_cmd = Command::new("disable_on_node")
.long_about("Stops Schema Definition Sync (SDS) on the given node")
.arg(Arg::new("node").short('n').long("node").required(true));
let enable_on_node_cmd = Command::new("enable_on_node")
.long_about("Resumes Schema Definition Sync (SDS) on the given node")
.arg(Arg::new("node").short('n').long("node").required(true));
let disable_cmd = Command::new("disable_cluster_wide")
.long_about("Stops Schema Definition Sync (SDS) on all cluster nodes");
let enable_cmd = Command::new("enable_cluster_wide")
.long_about("Resumes Schema Definition Sync (SDS) on all cluster nodes");
[
status_cmd,
disable_on_node_cmd,
disable_cmd,
enable_on_node_cmd,
enable_cmd,
]
}
fn wsr_subcommands() -> [Command; 1] {
let status_cmd = Command::new("status")
.long_about("Reports Warm Standby Replication (WSR) status on the target node");
[status_cmd]
}