{"record":{"id":"71b218121649557e","repo":"denisidoro/navi","slug":"no-variables-command-and-options-found-in-the-li","errorCode":null,"errorMessage":"No variables, command, and options found in the line `{}`","messagePattern":"No variables, command, and options found in the line `(.+?)`","errorType":"validation","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"src/parser.rs","lineNumber":90,"sourceCode":"                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\n        .captures(line)\n        .ok_or_else(|| anyhow!(\"No variables, command, and options found in the line `{}`\", line))?;\n    let variable = caps\n        .get(1)\n        .ok_or_else(|| anyhow!(\"No variable captured in the line `{}`\", line))?\n        .as_str()\n        .trim();\n    let mut command_plus_opts = caps\n        .get(2)\n        .ok_or_else(|| anyhow!(\"No command and options captured in the line `{}`\", line))?\n        .as_str()\n        .split(\"---\");\n    let command = command_plus_opts\n        .next()\n        .ok_or_else(|| anyhow!(\"No command captured in the line `{}`\", line))?;\n    let command_options = command_plus_opts.next().map(parse_opts).transpose()?;\n    Ok((variable, command, command_options))\n}\n\nfn without_prefix(line: &str) -> String {","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/denisidoro/navi/blob/f7330b9ad5bd95b7d1a3c96d00e0a77deb589147/src/parser.rs#L72-L108","documentation":"Thrown by `parse_variable_line` in src/parser.rs (called from `read_lines`) when a line in the source file does not match `VAR_LINE_REGEX` at all. The library expects variable-definition lines of the form `<var>: <command> --- [options]`, and any line failing the regex is rejected.","triggerScenarios":"Calling the file-parsing entry point (which walks lines via `read_lines`) on a line missing the required structure: no variable prefix (`#`, `%`, `@`), no `:` separator, or no command after the colon.","commonSituations":"Malformed config/snippet files after manual editing; comments or prose accidentally left inside the parsed file; wrong file passed to the tool; a changed line format after upgrading where the regex was tightened.","solutions":["Rewrite the line to match the expected `<prefix><var>: <command> --- [options]` format","Remove the invalid line or move comments outside the parsed file","Check for stray whitespace/special characters breaking the regex match","Verify you are pointing the tool at the correct file it is meant to parse"],"exampleFix":"// before (config line)\nthis line has no structure at all\n// after\nmy-var: cat file.txt --- --prompt \"Pick:\"","handlingStrategy":"validation","validationCode":"let valid = |line: &str| {\n    line.trim().is_empty()\n        || line.starts_with(['#', '%', '@']) && line.contains(':')\n};\n// skip or fix lines for which valid(line) is false before calling the parser","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the strict `<prefix><var>: <command> --- [options]` shape on every line","Keep comments out of parsed files","Lint config files with a quick regex check before running the tool"],"tags":["parsing","regex","config"],"backgroundTag":"unparseable-line","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"}