ctl_core/flags/mod.rs
1//! Shared clap flatten structs.
2
3mod color;
4mod dry_run;
5mod output;
6mod warn;
7
8pub use color::ColorLong;
9pub use dry_run::DryRunArgs;
10pub use output::{FormatArgs, OutputArgs};
11pub use warn::{FlagWarning, WarningKind, chassis_warnings, emit_warnings, warn_opposites};
12
13use crate::color::ColorMode;
14
15/// `--no-color` wins over a `--color` value.
16#[must_use]
17pub fn resolve_color(color: ColorMode, no_color: bool) -> ColorMode {
18 if no_color { ColorMode::Never } else { color }
19}
20
21/// Last-wins boolean after clap `overrides_with`. `on` is the yes flag.
22#[must_use]
23pub fn switch(on: bool, _off: bool) -> bool {
24 on
25}