fn get_clap_command()

in src/cmdline.rs [99:186]


fn get_clap_command() -> clap::Command {
    clap::Command::new(env!("CARGO_PKG_NAME"))
        .version(env!("CARGO_PKG_VERSION"))
        .max_term_width(110)
        .after_help(concat!(
            "Enabled features:\n",
            "    S3:        ",
            cfg!(feature = "s3"),
            "\n",
            "    Redis:     ",
            cfg!(feature = "redis"),
            "\n",
            "    Memcached: ",
            cfg!(feature = "memcached"),
            "\n",
            "    GCS:       ",
            cfg!(feature = "gcs"),
            "\n",
            "    GHA:       ",
            cfg!(feature = "gha"),
            "\n",
            "    Azure:     ",
            cfg!(feature = "azure"),
            "\n",
            "    WebDAV:    ",
            cfg!(feature = "webdav"),
            "\n",
            "    OSS:       ",
            cfg!(feature = "oss"),
            "\n"
        ))
        .args(&[
            flag_infer_long_and_short("show-stats")
                .help("show cache statistics")
                .action(ArgAction::SetTrue),
            flag_infer_long("show-adv-stats")
                .help("show advanced cache statistics")
                .action(ArgAction::SetTrue),
            flag_infer_long("start-server")
                .help("start background server")
                .action(ArgAction::SetTrue),
            flag_infer_long("debug-preprocessor-cache")
                .help("show all preprocessor cache entries")
                .action(ArgAction::SetTrue),
            flag_infer_long("stop-server")
                .help("stop background server")
                .action(ArgAction::SetTrue),
            flag_infer_long_and_short("zero-stats")
                .help("zero statistics counters")
                .action(ArgAction::SetTrue),
            flag_infer_long("dist-auth")
                .help("authenticate for distributed compilation")
                .action(ArgAction::SetTrue),
            flag_infer_long("dist-status")
                .help("show status of the distributed client")
                .action(ArgAction::SetTrue),
            flag_infer_long("package-toolchain")
                .help("package toolchain for distributed compilation")
                .value_parser(clap::value_parser!(PathBuf))
                .num_args(2)
                .value_names(["EXE", "OUT"]),
            flag_infer_long("stats-format")
                .help("set output format of statistics")
                .value_name("FMT")
                .value_parser(clap::value_parser!(StatsFormat))
                .default_value(StatsFormat::default().as_str()),
            Arg::new("CMD")
                .value_parser(clap::value_parser!(OsString))
                .trailing_var_arg(true)
                .action(ArgAction::Append),
        ])
        .group(
            ArgGroup::new("one_and_only_one")
                .args([
                    "dist-auth",
                    "debug-preprocessor-cache",
                    "dist-status",
                    "show-stats",
                    "show-adv-stats",
                    "start-server",
                    "stop-server",
                    "zero-stats",
                    "package-toolchain",
                    "CMD",
                ])
                .required(true),
        )
}