{"record":{"id":"297f57e30612cf65","repo":"denisidoro/navi","slug":"no-value-provided-for-the-flag","errorCode":null,"errorMessage":"No value provided for the flag `{}`","messagePattern":"No value provided for the flag `(.+?)`","errorType":"validation","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"src/parser.rs","lineNumber":70,"sourceCode":"                        opts.column = Some(\n                            value\n                                .parse::<u8>()\n                                .context(\"Value for `--column` is invalid u8\")?,\n                        )\n                    }\n                    \"--map\" => opts.map = Some(value.to_string()),\n                    \"--delimiter\" => opts.delimiter = Some(value.to_string()),\n                    \"--query\" => opts.query = Some(value.to_string()),\n                    \"--filter\" => opts.filter = Some(value.to_string()),\n                    \"--preview\" => opts.preview = Some(value.to_string()),\n                    \"--preview-window\" => opts.preview_window = Some(value.to_string()),\n                    \"--header\" => opts.header = Some(value.to_string()),\n                    \"--fzf-overrides\" => opts.overrides = Some(value.to_string()),\n                    _ => (),\n                }\n                Ok(())\n            } else if let [flag] = flag_and_value {\n                Err(anyhow!(\"No value provided for the flag `{}`\", flag))\n            } else {\n                unreachable!() // Chunking by 2 allows only for tuples of 1 or 2 items...\n            }\n        })\n        .context(\"Failed to parse finder options\")?;\n\n    let suggestion_type = match (multi, prevent_extra) {\n        (true, _) => SuggestionType::MultipleSelections, // multi wins over prevent-extra\n        (false, false) => SuggestionType::SingleRecommendation,\n        (false, true) => SuggestionType::SingleSelection,\n    };\n    opts.suggestion_type = suggestion_type;\n\n    Ok(opts)\n}\n\nfn parse_variable_line(line: &str) -> Result<(&str, &str, Option<FinderOpts>)> {\n    let caps = VAR_LINE_REGEX","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/denisidoro/navi/blob/f7330b9ad5bd95b7d1a3c96d00e0a77deb589147/src/parser.rs#L52-L88","documentation":"Thrown by `parse_opts` in src/parser.rs when an option flag appears as a chunk with no paired value. Options are split into (flag, value) pairs of 2; a lone flag that expects a value yields a 1-element chunk and produces this error, wrapped with the context \"Failed to parse finder options\".","triggerScenarios":"A finder options string containing a value-taking flag like `--header`, `--prompt`, or `--fzf-overrides` with nothing after it, e.g. `--- --prompt` or trailing whitespace stripping away the value.","commonSituations":"Deleting an option's value while editing a config but leaving the flag; line breaks in a config file dropping the value; typos where the value was written as a separate option.","solutions":["Provide the missing value after the flag, e.g. `--prompt \"Select:\"`","Remove the dangling flag entirely if the option is not needed","Check the config line for accidental line breaks or truncation that dropped the value","Use `--fzf-overrides` quoting correctly so the flag and its value stay paired"],"exampleFix":"// before\nmy-var: cat file.txt --- --prompt\n// after\nmy-var: cat file.txt --- --prompt \"Select a file:\"","handlingStrategy":"validation","validationCode":"fn every_flag_has_value(opts: &str) -> bool {\n    let toks: Vec<&str> = opts.split_whitespace().collect();\n    toks.iter().enumerate().all(|(i, t)| {\n        !(t.starts_with(\"--\") && *t != \"--header\" && *t != \"--prompt\"\n            && *t != \"--fzf-overrides\"\n            && t.starts_with(\"--header\")\n            || t.starts_with(\"--\") && (t == &\"--header\" || t == &\"--prompt\" || t == &\"--fzf-overrides\")\n                && toks.get(i + 1).map_or(true, |v| v.starts_with(\"--\")))\n    })\n}\n// simpler: grep the options string for a flag at the end: opts.trim_end().ends_with(any value-taking flag)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write flag and value together: `--prompt \"text\"`","Check config lines for truncation after edits","Validate the whole options line in a shell before saving"],"tags":["parsing","cli-options","config"],"backgroundTag":"missing-flag-value","analyzedSha":"f7330b9ad5bd95b7d1a3c96d00e0a77deb589147","analyzedAt":"2026-09-03T13:58:22.429Z","contentChangedAt":"2026-09-03T13:58:22.429Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}