batman_robin/cli/aggregation.rs
1use clap::{Arg, Command};
2
3/// Creates the CLI command for querying or modifying the aggregation setting.
4///
5/// # Returns
6/// - A `clap::Command` configured with:
7/// - Name: `"aggregation"`
8/// - Alias: `"ag"`
9/// - Short and long description: `"Display or modify aggregation setting."`
10/// - Usage override: `robctl [options] aggregation|ag [options] [0|1]`
11/// - Optional argument `value`:
12/// - Type: `u8`
13/// - Allowed values: `0` (disable) or `1` (enable)
14/// - Help: `"0 = disable aggregation, 1 = enable aggregation"`
15///
16/// # Notes
17/// - If no `value` is provided, the command can be used to display the current aggregation state.
18/// - Version flag is disabled for this command.
19pub fn cmd_aggregation() -> Command {
20 Command::new("aggregation")
21 .alias("ag")
22 .about("Display or modify aggregation setting.")
23 .long_about("Display or modify aggregation setting.")
24 .override_usage("\trobctl [options] aggregation|ag [options] [0|1]\n")
25 .arg(
26 Arg::new("value")
27 .value_name("0|1")
28 .required(false)
29 .value_parser(clap::value_parser!(u8).range(0..=1))
30 .help("0 = disable aggregation, 1 = enable aggregation"),
31 )
32 .disable_version_flag(true)
33}