{"record":{"id":"2cc723bea1927627","repo":"zellij-org/zellij","slug":"either-build-or-test-must-be-provided","errorCode":null,"errorMessage":"either '--build' or '--test' must be provided!","messagePattern":"either '--build' or '--test' must be provided!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/ci.rs","lineNumber":22,"sourceCode":"    flags::{self, BuildRelease, CiCmd, Cross, E2e},\n    metadata,\n};\nuse anyhow::Context;\nuse std::{\n    ffi::OsString,\n    path::{Path, PathBuf},\n};\nuse xshell::{cmd, Shell};\n\npub fn main(sh: &Shell, flags: flags::Ci) -> anyhow::Result<()> {\n    let err_context = \"failed to run CI task\";\n\n    match flags.subcommand {\n        CiCmd::E2e(E2e {\n            build: false,\n            test: false,\n            ..\n        }) => Err(anyhow::anyhow!(\n            \"either '--build' or '--test' must be provided!\"\n        )),\n        CiCmd::E2e(E2e {\n            build: true,\n            test: true,\n            ..\n        }) => Err(anyhow::anyhow!(\n            \"flags '--build' and '--test' are mutually exclusive!\"\n        )),\n        CiCmd::E2e(E2e {\n            build: true,\n            test: false,\n            ..\n        }) => e2e_build(sh),\n        CiCmd::E2e(E2e {\n            build: false,\n            test: true,\n            args,","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/xtask/src/ci.rs#L4-L40","documentation":"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.","triggerScenarios":"Running `cargo xtask ci e2e` with no flags.","commonSituations":"Copy-pasting a partial CI command; scripts written before the flags existed; typos in flag names so both parse as false.","solutions":["Run `cargo xtask ci e2e --build` to build, or `cargo xtask ci e2e --test` to test","Check `cargo xtask ci e2e --help` for the accepted flags"],"exampleFix":"# before\ncargo xtask ci e2e\n\n# after\ncargo xtask ci e2e --build","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# wrap ci e2e invocations\nif [[ -z \"$BUILD\" && -z \"$TEST\" ]]; then\n  echo \"usage: $0 --build | --test\"; exit 2\nfi\ncargo xtask ci e2e ${BUILD:+--build} ${TEST:+--test}","typeGuard":"fn e2e_flags_valid(build: bool, test: bool) -> bool {\n    build ^ test // exactly one must be set\n}","tryCatchPattern":null,"preventionTips":["Script the CI invocation with a fixed mode flag instead of composing flags from variables","Run `cargo xtask ci e2e --help` when adding the step to a new pipeline"],"tags":["cli","usage","flags","ci","e2e"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}