{"id":"3e6551b7b7259996","repo":"BurntSushi/ripgrep","slug":"unrecognized-flag-name","errorCode":null,"errorMessage":"unrecognized flag -{name}","messagePattern":"unrecognized flag -(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/core/flags/parse.rs","lineNumber":263,"sourceCode":"                lexopt::Arg::Short(ch) => self.find_short(ch),\n                lexopt::Arg::Long(name) if name == \"help\" => {\n                    // Special case -h/--help since behavior is different\n                    // based on whether short or long flag is given.\n                    args.special = Some(SpecialMode::HelpLong);\n                    continue;\n                }\n                lexopt::Arg::Long(name) if name == \"version\" => {\n                    // Special case -V/--version since behavior is different\n                    // based on whether short or long flag is given.\n                    args.special = Some(SpecialMode::VersionLong);\n                    continue;\n                }\n                lexopt::Arg::Long(name) => self.find_long(name),\n            };\n            let mat = match lookup {\n                FlagLookup::Match(mat) => mat,\n                FlagLookup::UnrecognizedShort(name) => {\n                    anyhow::bail!(\"unrecognized flag -{name}\")\n                }\n                FlagLookup::UnrecognizedLong(name) => {\n                    let mut msg = format!(\"unrecognized flag --{name}\");\n                    if let Some(suggest_msg) = suggest(&name) {\n                        msg = format!(\"{msg}\\n\\n{suggest_msg}\");\n                    }\n                    anyhow::bail!(\"{msg}\")\n                }\n            };\n            let value = if matches!(mat.kind, FlagInfoKind::Negated) {\n                // Negated flags are always switches, even if the non-negated\n                // flag is not. For example, --context-separator accepts a\n                // value, but --no-context-separator does not.\n                FlagValue::Switch(false)\n            } else if mat.flag.is_switch() {\n                FlagValue::Switch(true)\n            } else {\n                FlagValue::Value(p.value().with_context(|| {","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/flags/parse.rs#L245-L281","documentation":"Error \"unrecognized flag -{name}\" thrown in BurntSushi/ripgrep.","triggerScenarios":"Thrown at crates/core/flags/parse.rs:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the short flag spelling; run --help for the list of valid flags","Use the long form of the flag if the short form does not exist"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"3fce3b5bb0236da2df6d99672afb8a719642eca7","analyzedAt":"2026-08-06T01:39:05.073Z","schemaVersion":2}