cli: only warn about --annotate when explicitly passed via CLI (#531)

The warning "⚠ --annotate only applies to the screenshot command" fires
on every non-screenshot command when annotate is set in config. This is
noisy for users who set it as a persistent default.

Add cli_annotate tracking (matching the existing cli_* pattern) so the
warning only fires when --annotate is passed as a CLI flag.
This commit is contained in:
Lukas Malkmus
2026-02-23 09:24:19 -06:00
committed by GitHub
parent c0f8f32a55
commit f10f3f6425
2 changed files with 18 additions and 1 deletions
+2 -1
View File
@@ -83,7 +83,7 @@ pub fn parse_command(args: &[String], flags: &Flags) -> Result<Value, ParseError
let rest: Vec<&str> = args[1..].iter().map(|s| s.as_str()).collect();
let id = gen_id();
if flags.annotate && cmd != "screenshot" {
if flags.cli_annotate && cmd != "screenshot" {
eprintln!(
"{} --annotate only applies to the screenshot command",
color::warning_indicator()
@@ -1863,6 +1863,7 @@ mod tests {
cli_proxy: false,
cli_proxy_bypass: false,
cli_allow_file_access: false,
cli_annotate: false,
annotate: false,
color_scheme: None,
}