helen 0.1.0

Repository review gate.
Documentation
//! Command-line dispatch for Helen.

use crate::elenchus;
use clap::{Parser, Subcommand};
use std::process::ExitCode;

/// Top-level Helen command line.
#[derive(Debug, Parser)]
#[command(author, version, about)]
struct Cli {
    /// Command to run.
    #[command(subcommand)]
    command: Command,
}

/// Helen subcommands.
#[derive(Debug, Subcommand)]
enum Command {
    /// Run the elenchus verification and review gate.
    Elenchus {
        /// Conventional Commit subject, or `approve` after a paused review.
        #[arg(value_name = "MESSAGE", num_args = 0..)]
        args: Vec<String>,
    },
}

/// Runs the selected command-line mode.
#[must_use]
pub fn run() -> ExitCode {
    let cli = Cli::parse();

    match cli.command {
        Command::Elenchus { args } => elenchus::run(elenchus::Args::new(args)).into_exit_code(),
    }
}