distrib 0.0.0

Distrib helps you distribute your software.
Documentation
// This is free and unencumbered software released into the public domain.

use clientele::{
    StandardOptions, SysexitsError,
    crates::clap::{Parser, Subcommand},
};

/// Distrib helps you distribute your software.
#[derive(Debug, Parser)]
#[command(name = "Distrib", long_about)]
#[command(arg_required_else_help = true)]
struct Options {
    #[clap(flatten)]
    flags: StandardOptions,

    #[command(subcommand)]
    command: Option<Command>,
}

#[derive(Debug, Subcommand)]
enum Command {}

pub fn main() -> Result<(), SysexitsError> {
    // Load environment variables from `.env`:
    clientele::dotenv().ok();

    // Expand wildcards and @argfiles:
    let args = clientele::args_os()?;

    // Parse command-line options:
    let options = Options::parse_from(args);

    // Print the program version, if requested:
    if options.flags.version {
        println!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"));
        return Ok(());
    }

    // Print the program license, if requested:
    if options.flags.license {
        print!("{}", include_str!("../UNLICENSE"));
        return Ok(());
    }

    // Configure debug output:
    if options.flags.debug {}

    // TODO: match options.command.unwrap() {}

    Ok(())
}