zellij-org/zellij · error

either '--build' or '--test' must be provided!

Error message

either '--build' or '--test' must be provided!

What it means

The `ci e2e` subcommand requires exactly one mode flag: --build (build the E2E binary and data dir) or --test (run the E2E tests). Invoking it with neither is a usage error caught in the match arms before any work runs.

Source

Thrown at xtask/src/ci.rs:22

    flags::{self, BuildRelease, CiCmd, Cross, E2e},
    metadata,
};
use anyhow::Context;
use std::{
    ffi::OsString,
    path::{Path, PathBuf},
};
use xshell::{cmd, Shell};

pub fn main(sh: &Shell, flags: flags::Ci) -> anyhow::Result<()> {
    let err_context = "failed to run CI task";

    match flags.subcommand {
        CiCmd::E2e(E2e {
            build: false,
            test: false,
            ..
        }) => Err(anyhow::anyhow!(
            "either '--build' or '--test' must be provided!"
        )),
        CiCmd::E2e(E2e {
            build: true,
            test: true,
            ..
        }) => Err(anyhow::anyhow!(
            "flags '--build' and '--test' are mutually exclusive!"
        )),
        CiCmd::E2e(E2e {
            build: true,
            test: false,
            ..
        }) => e2e_build(sh),
        CiCmd::E2e(E2e {
            build: false,
            test: true,
            args,

View on GitHub (pinned to 98a0837077)

Solutions

  1. Run `cargo xtask ci e2e --build` to build, or `cargo xtask ci e2e --test` to test
  2. Check `cargo xtask ci e2e --help` for the accepted flags

Example fix

# before
cargo xtask ci e2e

# after
cargo xtask ci e2e --build
Defensive patterns

Strategy: validation

Validate before calling

#!/usr/bin/env bash
# wrap ci e2e invocations
if [[ -z "$BUILD" && -z "$TEST" ]]; then
  echo "usage: $0 --build | --test"; exit 2
fi
cargo xtask ci e2e ${BUILD:+--build} ${TEST:+--test}

Type guard

fn e2e_flags_valid(build: bool, test: bool) -> bool {
    build ^ test // exactly one must be set
}

Prevention

When it happens

Trigger: Running `cargo xtask ci e2e` with no flags.

Common situations: Copy-pasting a partial CI command; scripts written before the flags existed; typos in flag names so both parse as false.

Related errors


AI-assisted analysis of zellij-org/zellij@98a0837077 (2026-08-16). Data as JSON: /api/errors/2cc723bea1927627. Report an issue: GitHub.