Add more Clap constraints
Summary:
Make --snapshot incompatible with --host in replqy.
Make --port require --host.
@@ -137,7 +137,7 @@ enum Command {
#[clap(long)]
host: Option<String>,
/// Override default port to connect remote viewing to
- #[clap(long)]
+ #[clap(long, requires("host"))]
port: Option<u16>,
},
/// Record local system data (daemon mode)
@@ -197,7 +197,7 @@ enum Command {
#[clap(long)]
host: Option<String>,
/// Override default port to connect remote viewing to
- #[clap(long)]
+ #[clap(long, requires("host"))]
port: Option<u16>,
/// Days adjuster: y[y...] for yesterday (repeated).
/// Each "y" will deduct 1 day from the input of "--time/-t"{n}
@@ -208,7 +208,7 @@ enum Command {
yesterdays: Option<String>,
/// Replay from a snapshot file generated by the snapshot
/// command instead of from the store directory.
- #[clap(long)]
+ #[clap(long, conflicts_with("host"))]
snapshot: Option<String>,
},
/// Debugging facilities (for development use)
@@ -222,7 +222,7 @@ enum Command {
#[clap(long)]
host: Option<String>,
/// Override default port to connect remote dumping to
- #[clap(long)]
+ #[clap(long, requires("host"))]
port: Option<u16>,
#[clap(subcommand)]
cmd: DumpCommand,
@@ -238,9 +238,8 @@ enum Command {
/// Supply hostname to take snapshot from remote
#[clap(long)]
host: Option<String>,
- #[clap(long)]
/// Override default port to connect to remote
- #[clap(long)]
+ #[clap(long, requires("host"))]
port: Option<u16>,
},
/// Generate a shell completions file
@@ -278,7 +277,7 @@ enum DebugCommand {
to_store_dir: PathBuf,
#[clap(long)]
host: Option<String>,
- #[clap(long)]
+ #[clap(long, requires("host"))]
port: Option<u16>,
/// Options for compression
#[clap(flatten)]
