//! `wai_http_vectors` — writes and verifies the HTTP delivery corpus
//! (`extensions/http-delivery.md` §14, `wai/http-conformance/`). The same tool is
//! `wai http vectors`.
//!
//!   wai_http_vectors gen    <http-conformance dir>
//!   wai_http_vectors verify <http-conformance dir>
//!   wai_http_vectors diff   <http-conformance dir> --seed S --count N --out F
//!
//! Exit status 1 when a case does not give its committed outcome or a file does not
//! regenerate to its committed bytes, each named on its own line.

use std::process::ExitCode;

#[path = "wai_cli/http_vectors.rs"]
mod http_vectors;

// The writes `http_vectors` makes go through `out`, as they do in `wai http vectors`, which
// takes `--dry-run`; this tool never sets it.
#[allow(dead_code)]
#[path = "wai_cli/out.rs"]
mod out;

fn main() -> ExitCode {
    let args: Vec<String> = std::env::args().skip(1).collect();
    match http_vectors::main(&args) {
        Ok(true) => ExitCode::SUCCESS,
        Ok(false) => ExitCode::from(1),
        Err(e) => {
            eprintln!("error: {e}");
            ExitCode::from(2)
        }
    }
}
