zed-industries/zed · error

usage: ep split [input.jsonl] train.jsonl=80% valid.jsonl=re

Error message

usage: ep split [input.jsonl] train.jsonl=80% valid.jsonl=rest

What it means

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.

Source

Thrown at crates/edit_prediction_cli/src/split_dataset.rs:227

    let file =
        File::create(path).with_context(|| format!("failed to create '{}'", path.display()))?;
    let mut writer = BufWriter::new(file);

    for line in lines {
        writeln!(writer, "{}", line)
            .with_context(|| format!("failed to write to '{}'", path.display()))?;
    }

    writer
        .flush()
        .with_context(|| format!("failed to flush '{}'", path.display()))?;

    Ok(())
}

pub fn run_split(args: &SplitArgs, inputs: &[PathBuf]) -> Result<()> {
    if inputs.is_empty() {
        bail!("usage: ep split [input.jsonl] train.jsonl=80% valid.jsonl=rest");
    }

    let (input_path, split_specs_raw): (Option<&Path>, &[PathBuf]) =
        if inputs.first().is_some_and(|p| {
            let s = p.to_string_lossy();
            !s.contains('=')
        }) {
            let first = inputs.first().map(|p| p.as_path());
            let first = if first == Some(Path::new("-")) {
                None
            } else {
                first
            };
            (first, &inputs[1..])
        } else {
            (None, inputs)
        };

View on GitHub (pinned to f4178619ac)

Solutions

  1. Re-run with input plus specs, e.g. `ep split input.jsonl train.jsonl=80% valid.jsonl=rest`
  2. If reading from stdin, you may omit the input path but must still pass at least one spec
  3. Check the calling script's variable expansion so empty arrays don't erase the arguments

Example fix

# before
ep split

# after
ep split input.jsonl train.jsonl=80% valid.jsonl=rest
Defensive patterns

Strategy: validation

Validate before calling

if args.is_empty() {
    // print usage and fail before spawning: split needs >= 1 spec
}

Try / catch

Check the argument vector is non-empty before invoking; surface a usage string at the caller level so the tool's bail never fires.

Prevention

When it happens

Trigger: Running bare `ep split`, or through a script where an unquoted empty shell variable expands to zero arguments.

Common situations: Shell scripts passing `"$INPUTS"`-style variables that are empty; misconfigured task runners dropping arguments; exploring the CLI without arguments expecting help output.

Understand the failure class

Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.

Related errors


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/bcf3845f201964f4. Report an issue: GitHub.