{"id":"d4083e092f4ce53b","repo":"BurntSushi/ripgrep","slug":"flag-does-not-support-indexing","errorCode":null,"errorMessage":"flag --{} does not support indexing","messagePattern":"flag --(.+?) does not support indexing","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/core/flags/hiargs.rs","lineNumber":129,"sourceCode":"    ///\n    /// This process can fail for a variety of reasons. For example, invalid\n    /// globs or some kind of environment issue.\n    pub(crate) fn from_low_args(mut low: LowArgs) -> anyhow::Result<HiArgs> {\n        // Callers should not be trying to convert low-level arguments when\n        // a short-circuiting special mode is present.\n        assert_eq!(None, low.special, \"special mode demands short-circuiting\");\n        // If the sorting mode isn't supported, then we bail loudly. I'm not\n        // sure if this is the right thing to do. We could silently \"not sort\"\n        // as well. If we wanted to go that route, then we could just set\n        // `low.sort = None` if `supported()` returns an error.\n        if let Some(ref sort) = low.sort {\n            sort.supported()?;\n        }\n        // We aggressively ban things from indexing at present.\n        if (low.index > 0 || matches!(low.mode, Mode::Index(_)))\n            && let Some(flag) = low.indexing_unsupported_flag()\n        {\n            anyhow::bail!(\n                \"flag --{} does not support indexing\",\n                flag.name_long()\n            );\n        }\n\n        // We modify the mode in-place on `low` so that subsequent conversions\n        // see the correct mode.\n        match low.mode {\n            Mode::Search(ref mut mode) => match *mode {\n                // treat `-v --count-matches` as `-v --count`\n                SearchMode::CountMatches if low.invert_match => {\n                    *mode = SearchMode::Count;\n                }\n                // treat `-o --count` as `--count-matches`\n                SearchMode::Count if low.only_matching => {\n                    *mode = SearchMode::CountMatches;\n                }\n                _ => {}","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/flags/hiargs.rs#L111-L147","documentation":"Error \"flag --{} does not support indexing\" thrown in BurntSushi/ripgrep.","triggerScenarios":"Thrown at crates/core/flags/hiargs.rs:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the index suffix from the flag; only certain flags support indexing","Consult ripgrep's --help to see which flags accept an index"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"3fce3b5bb0236da2df6d99672afb8a719642eca7","analyzedAt":"2026-08-06T01:39:05.073Z","schemaVersion":2}