{"record":{"id":"bcf3845f201964f4","repo":"zed-industries/zed","slug":"usage-ep-split-input-jsonl-train-jsonl-80-vali","errorCode":null,"errorMessage":"usage: ep split [input.jsonl] train.jsonl=80% valid.jsonl=rest","messagePattern":"usage: ep split \\[input\\.jsonl\\] train\\.jsonl=80% valid\\.jsonl=rest","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/split_dataset.rs","lineNumber":227,"sourceCode":"    let file =\n        File::create(path).with_context(|| format!(\"failed to create '{}'\", path.display()))?;\n    let mut writer = BufWriter::new(file);\n\n    for line in lines {\n        writeln!(writer, \"{}\", line)\n            .with_context(|| format!(\"failed to write to '{}'\", path.display()))?;\n    }\n\n    writer\n        .flush()\n        .with_context(|| format!(\"failed to flush '{}'\", path.display()))?;\n\n    Ok(())\n}\n\npub fn run_split(args: &SplitArgs, inputs: &[PathBuf]) -> Result<()> {\n    if inputs.is_empty() {\n        bail!(\"usage: ep split [input.jsonl] train.jsonl=80% valid.jsonl=rest\");\n    }\n\n    let (input_path, split_specs_raw): (Option<&Path>, &[PathBuf]) =\n        if inputs.first().is_some_and(|p| {\n            let s = p.to_string_lossy();\n            !s.contains('=')\n        }) {\n            let first = inputs.first().map(|p| p.as_path());\n            let first = if first == Some(Path::new(\"-\")) {\n                None\n            } else {\n                first\n            };\n            (first, &inputs[1..])\n        } else {\n            (None, inputs)\n        };\n","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/split_dataset.rs#L209-L245","documentation":"Bailed by run_split when `ep split` was invoked with no positional arguments at all. The command requires at least one `<path>=<size>` split spec (and optionally one leading input path); with an empty argument list it prints the usage line and exits with an error.","triggerScenarios":"Running bare `ep split`, or through a script where an unquoted empty shell variable expands to zero arguments.","commonSituations":"Shell scripts passing `\"$INPUTS\"`-style variables that are empty; misconfigured task runners dropping arguments; exploring the CLI without arguments expecting help output.","solutions":["Re-run with input plus specs, e.g. `ep split input.jsonl train.jsonl=80% valid.jsonl=rest`","If reading from stdin, you may omit the input path but must still pass at least one spec","Check the calling script's variable expansion so empty arrays don't erase the arguments"],"exampleFix":"# before\nep split\n\n# after\nep split input.jsonl train.jsonl=80% valid.jsonl=rest","handlingStrategy":"validation","validationCode":"if args.is_empty() {\n    // print usage and fail before spawning: split needs >= 1 spec\n}","typeGuard":null,"tryCatchPattern":"Check the argument vector is non-empty before invoking; surface a usage string at the caller level so the tool's bail never fires.","preventionTips":["Assert non-empty inputs when building the command programmatically","Quote shell variables so empty values don't erase arguments","Run the bare subcommand's --help when unsure of required arguments"],"tags":["cli","usage","missing-arguments","rust"],"backgroundTag":"missing-cli-argument","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}