{"record":{"id":"bafce024c1b7aff6","repo":"a-b-street/abstreet","slug":"invalid-color-scheme-choices","errorCode":null,"errorMessage":"Invalid --color_scheme={}. Choices: {}","messagePattern":"Invalid --color_scheme=(.+?)\\. Choices: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"map_gui/src/colors.rs","lineNumber":56,"sourceCode":"    pub fn choices() -> Vec<Choice<ColorSchemeChoice>> {\n        vec![\n            Choice::new(\"day mode\", ColorSchemeChoice::DayMode),\n            Choice::new(\"night mode\", ColorSchemeChoice::NightMode),\n            Choice::new(\"textured\", ColorSchemeChoice::Textured),\n            Choice::new(\"classic\", ColorSchemeChoice::ClassicDayMode),\n            Choice::new(\"LTN\", ColorSchemeChoice::LTN),\n        ]\n    }\n\n    pub fn parse(x: &str) -> Result<ColorSchemeChoice> {\n        let mut options = Vec::new();\n        for c in ColorSchemeChoice::choices() {\n            options.push(c.label.clone());\n            if c.label == x {\n                return Ok(c.data);\n            }\n        }\n        bail!(\n            \"Invalid --color_scheme={}. Choices: {}\",\n            x,\n            options.join(\", \")\n        );\n    }\n}\n\npub struct ColorScheme {\n    scheme: ColorSchemeChoice,\n\n    pub road_outlines: bool,\n    pub road_class_colors: bool,\n    pub show_buildings_in_minimap: bool,\n\n    // UI\n    pub panel_bg: Color,\n    pub inner_panel_bg: Color,\n    pub day_time_slider: Color,","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/map_gui/src/colors.rs#L38-L74","documentation":"The ColorSchemeChoice::parse function maps a user-supplied string (usually the --color_scheme CLI flag) to a ColorScheme by exact label match. If no choice label equals the input, it bails listing all valid choices.","triggerScenarios":"Launching any map_gui-based game/binary with --color_scheme set to a misspelled or unknown name, e.g. --color_scheme=dark instead of a defined scheme label.","commonSituations":"Typo in a command line, stale scripts referencing removed/renamed color schemes after upgrades, case mismatches.","solutions":["Use one of the exact choices printed in the error message (run with --help or read the list).","Fix the spelling/casing in your script or alias.","If a scheme was renamed between versions, update the flag to the new label."],"exampleFix":"// before\n./game --color_scheme=nite\n// after\n./game --color_scheme=night","handlingStrategy":"validation","validationCode":"let valid: Vec<&str> = ColorSchemeChoice::choices().iter().map(|c| c.label.as_str()).collect();\nif !valid.contains(&scheme.as_str()) {\n    bail!(\"--color_scheme must be one of: {}\", valid.join(\", \"));\n}","typeGuard":null,"tryCatchPattern":"let scheme = match ColorSchemeChoice::parse(&flag) {\n    Ok(s) => s,\n    Err(e) => { eprintln!(\"{e}\"); std::process::exit(2); }\n};","preventionTips":["Copy the scheme name from the choices list in the error message","Use tab-completion or a wrapper script for CLI flags","Re-check flag names after upgrading the tool since choices may change"],"tags":["cli","color-scheme","gui"],"backgroundTag":"invalid-cli-argument","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}