{"id":"14d25685c7c55363","repo":"BurntSushi/ripgrep","slug":"choice-unk-is-unrecognized","errorCode":null,"errorMessage":"choice '{unk}' is unrecognized","messagePattern":"choice '(.+?)' is unrecognized","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/core/flags/defs.rs","lineNumber":847,"sourceCode":"    \\-\\-colors 'line:none' \\\\\n    \\-\\-colors 'column:none' \\\\\n    \\-\\-colors 'match:none' \\\\\n    \\-\\-colors 'highlight:none'\n.EE\n.sp\n\"\n    }\n    fn doc_choices(&self) -> &'static [&'static str] {\n        &[\"never\", \"auto\", \"always\", \"ansi\"]\n    }\n\n    fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> {\n        args.color = match convert::str(&v.unwrap_value())? {\n            \"never\" => ColorChoice::Never,\n            \"auto\" => ColorChoice::Auto,\n            \"always\" => ColorChoice::Always,\n            \"ansi\" => ColorChoice::Ansi,\n            unk => anyhow::bail!(\"choice '{unk}' is unrecognized\"),\n        };\n        Ok(())\n    }\n}\n\n#[cfg(test)]\n#[test]\nfn test_color() {\n    let args = parse_low_raw(None::<&str>).unwrap();\n    assert_eq!(ColorChoice::Auto, args.color);\n\n    let args = parse_low_raw([\"--color\", \"never\"]).unwrap();\n    assert_eq!(ColorChoice::Never, args.color);\n\n    let args = parse_low_raw([\"--color\", \"auto\"]).unwrap();\n    assert_eq!(ColorChoice::Auto, args.color);\n\n    let args = parse_low_raw([\"--color\", \"always\"]).unwrap();","sourceCodeStart":829,"sourceCodeEnd":865,"githubUrl":"https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/flags/defs.rs#L829-L865","documentation":"Error \"choice '{unk}' is unrecognized\" thrown in BurntSushi/ripgrep.","triggerScenarios":"Thrown at crates/core/flags/defs.rs:847 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the list of valid choices for this flag and use one of them","Fix any typo in the value you passed to the flag"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"3fce3b5bb0236da2df6d99672afb8a719642eca7","analyzedAt":"2026-08-06T01:39:05.073Z","schemaVersion":2}