{"id":"2eedb6ae32c241d7","repo":"BurntSushi/ripgrep","slug":"unrecognized-flag-name-2eedb6","errorCode":null,"errorMessage":"unrecognized flag --{name}","messagePattern":"unrecognized flag --(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/core/flags/parse.rs","lineNumber":270,"sourceCode":"                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(|| {\n                    format!(\"missing value for flag {mat}\")\n                })?)\n            };\n            mat.flag\n                .update(value, args)\n                .with_context(|| format!(\"error parsing flag {mat}\"))?;\n        }","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/flags/parse.rs#L252-L288","documentation":"Error \"unrecognized flag --{name}\" thrown in BurntSushi/ripgrep.","triggerScenarios":"Thrown at crates/core/flags/parse.rs:270 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the flag spelling; run --help for the list of valid flags","Remove the flag if it is not supported by this version"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"3fce3b5bb0236da2df6d99672afb8a719642eca7","analyzedAt":"2026-08-06T01:39:05.073Z","schemaVersion":2}