{"record":{"id":"1527677e717180f0","repo":"astrid-runtime/astrid","slug":"output-requires-a-path","errorCode":null,"errorMessage":"--output requires a path","messagePattern":"--output requires a path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-chunker-evidence/src/main.rs","lineNumber":176,"sourceCode":"                version_chain_specs.push(parse_path_specification(\"--version-chain\", args.next())?);\n            },\n            \"--git-history\" => {\n                git_history_specs.push(parse_git_specification(args.next())?);\n            },\n            \"--no-synthetic\" => include_synthetic = false,\n            \"--sketch-only\" => sketch_only = true,\n            \"--target-kib\" => {\n                let target = args\n                    .next()\n                    .ok_or_else(|| anyhow::anyhow!(\"--target-kib requires an integer\"))?\n                    .parse::<u32>()\n                    .context(\"parse --target-kib\")?;\n                targets_kib.push(target);\n            },\n            \"--output\" => {\n                let path = args\n                    .next()\n                    .ok_or_else(|| anyhow::anyhow!(\"--output requires a path\"))?;\n                output = Some(PathBuf::from(path));\n            },\n            \"-h\" | \"--help\" => {\n                print_help();\n                std::process::exit(0);\n            },\n            unknown => bail!(\"unknown argument {unknown:?}; use --help\"),\n        }\n    }\n    if targets_kib.is_empty() {\n        targets_kib.push(64);\n    }\n    targets_kib.sort_unstable();\n    targets_kib.dedup();\n    Ok(Options {\n        corpus_specs,\n        version_chain_specs,\n        git_history_specs,","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-chunker-evidence/src/main.rs#L158-L194","documentation":"CLI argument parse error in `parse_options`: `--output` was given but the next argument is missing. The flag requires a following filesystem path where the compact JSON report is written instead of stdout.","triggerScenarios":"Running the binary as `... --output` with no path after it — the flag ends the argument list or is followed by another flag, so `args.next()` returns `None`.","commonSituations":"Truncated command from a script; empty variable interpolated as the output path; mistaking `--output` for a boolean flag and passing only it.","solutions":["Supply the path: `--output report.json`.","In scripts, verify the output variable is non-empty before invoking the binary.","Check `--help` for the `--output PATH` syntax."],"exampleFix":"// before\nmybin --corpus c=dir --output\n// after\nmybin --corpus c=dir --output out/report.json","handlingStrategy":"validation","validationCode":"fn output_path_provided(args: &[String]) -> bool {\n    args.iter().position(|a| a == \"--output\")\n        .map(|i| args.get(i + 1).map_or(false, |v| !v.starts_with(\"--\")))\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"let path = std::env::args().skip(1)\n    .skip_while(|a| a != \"--output\").nth(1);\nassert!(path.is_some(), \"--output requires a path\");","preventionTips":["Verify script variables holding output paths are non-empty before invocation.","Never treat --output as a boolean flag.","Check --help for the required `--output PATH` form."],"tags":["cli","rust","argument-parsing"],"backgroundTag":"missing-cli-argument","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}