{"record":{"id":"11ae7d5a1d3fcb19","repo":"linera-io/linera-protocol","slug":"output-specified-but-resolved-to-no-entries","errorCode":null,"errorMessage":"--output specified but resolved to no entries","messagePattern":"--output specified but resolved to no entries","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-service/src/cli/validator_benchmark/report.rs","lineNumber":59,"sourceCode":"    pub fn parse_all(raw: &[String]) -> Result<Vec<OutputSpec>> {\n        if raw.is_empty() {\n            return Ok(vec![OutputSpec {\n                format: Format::Md,\n                target: Target::Stdout,\n            }]);\n        }\n        let mut out = Vec::new();\n        for item in raw {\n            for part in item.split([',', '+']) {\n                let part = part.trim();\n                if part.is_empty() {\n                    continue;\n                }\n                out.push(Self::parse_one(part)?);\n            }\n        }\n        if out.is_empty() {\n            return Err(anyhow!(\"--output specified but resolved to no entries\"));\n        }\n        Ok(out)\n    }\n\n    fn parse_one(s: &str) -> Result<OutputSpec> {\n        let (fmt_str, target) = match s.split_once(':') {\n            Some((f, p)) => (f, Target::File(PathBuf::from(p))),\n            None => (s, Target::Stdout),\n        };\n        let format = match fmt_str {\n            \"json\" => Format::Json,\n            \"yaml\" => Format::Yaml,\n            \"md\" => Format::Md,\n            \"brief\" => Format::Brief,\n            other => {\n                return Err(anyhow!(\n                    \"unknown output format `{other}` (expected json|yaml|md|brief)\"\n                ))","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/cli/validator_benchmark/report.rs#L41-L77","documentation":"--output was supplied but parsing it yielded zero usable entries. parse_all skips empty/blank segments while collecting FORMAT:TARGET specs; if every segment was skipped (or the value was empty), the flag is considered misconfigured and fails rather than silently writing nothing.","triggerScenarios":"`--output \"\"`, a value made only of separators/whitespace, or shell quoting that expands to an empty string (e.g. an unset variable inside quotes).","commonSituations":"Scripts passing $OUTPUT_SPEC without a default; YAML/CI templates with an empty output field; trailing separators after a deleted entry.","solutions":["Provide at least one format:target spec, e.g. `--output json:report.json`.","Echo the argument just before invoking the tool to catch empty shell variables.","Strip trailing separators/whitespace when composing the value programmatically.","Drop the flag entirely if no report file is wanted."],"exampleFix":"# before: empty value resolves to no entries\n--output \"\"            # or: --output \"${OUTPUT_SPEC}\" with OUTPUT_SPEC unset\n\n# after: at least one FORMAT:TARGET entry\n--output json:report.json","handlingStrategy":"validation","validationCode":"let entries: Vec<&str> = arg\n    .split(',')\n    .map(str::trim)\n    .filter(|s| !s.is_empty())\n    .collect();\nensure!(!entries.is_empty(), \"--output needs at least one FORMAT:TARGET entry\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default output variables in scripts: \"${OUTPUT_SPEC:-json:report.json}\" or drop the flag.","Echo composed CLI arguments before executing them to catch empty values."],"tags":["cli","parsing","output"],"backgroundTag":"invalid-cli-argument-format","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}