zed-industries/zed · error

Required argument

Error message

Required argument

What it means

Panics in the docs preprocessor's mdbook `supports` subcommand when the renderer name argument is missing. mdbook invokes `supports <renderer>` and this binary requires exactly that argument; it is a build-time tool, not user-facing.

Source

Thrown at crates/docs_preprocessor/src/main.rs:79

    fn keymap(self, os: Os) -> &'static KeymapFile {
        match (self, os) {
            (Self::JetBrains, Os::MacOs) => &KEYMAP_JETBRAINS_MACOS,
            (Self::JetBrains, Os::Linux | Os::Windows) => &KEYMAP_JETBRAINS_LINUX,
        }
    }
}

const FRONT_MATTER_COMMENT: &str = "<!-- ZED_META {} -->";

fn main() -> Result<()> {
    zlog::init();
    zlog::init_output_stderr();
    let args = std::env::args().skip(1).collect::<Vec<_>>();

    match args.get(0).map(String::as_str) {
        Some("supports") => {
            let renderer = args.get(1).expect("Required argument");
            let supported = renderer != "not-supported";
            if supported {
                process::exit(0);
            } else {
                process::exit(1);
            }
        }
        Some("postprocess") => handle_postprocessing()?,
        _ => handle_preprocessing()?,
    }

    Ok(())
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
enum PreprocessorError {
    ActionNotFound {
        action_name: String,

View on GitHub (pinned to f4178619ac)

Solutions

  1. Invoke the preprocessor as mdbook expects: `docs_preprocessor supports <renderer>`
  2. Check the mdbook backend configuration points at the right command
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/docs_preprocessor/src/main.rs:79 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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