lockfiles 0.0.1

Multi-ecosystem lockfile parser that normalizes resolved dependencies, keyed by PURL.
Documentation
//! Command-line entry point for `lockfiles`.
//!
//! The parser is not implemented yet; this binary only answers `--version` and
//! `--help` so the CLI surface exists and is exercised by CI.

#![forbid(unsafe_code)]

use std::process::ExitCode;

const HELP: &str = "\
lockfiles: multi-ecosystem lockfile parser (work in progress)

Usage:
    lockfiles [OPTIONS]

Options:
    -h, --help       Print this help
    -V, --version    Print version

No parsing commands are available yet; the name is reserved while the
implementation is developed.
";

fn main() -> ExitCode {
    match std::env::args().nth(1).as_deref() {
        Some("-V" | "--version") => {
            println!("lockfiles {}", lockfiles::version());
            ExitCode::SUCCESS
        }
        None | Some("-h" | "--help") => {
            print!("{HELP}");
            ExitCode::SUCCESS
        }
        Some(other) => {
            eprintln!("error: unexpected argument '{other}'");
            eprintln!("try 'lockfiles --help'");
            ExitCode::from(2)
        }
    }
}