use crate::{install::install, setup::setup};
use clap::{Parser, Subcommand};
#[derive(Debug, Parser)]
#[clap(name = "wireman", version)]
pub struct Args {
#[clap(subcommand)]
pub command: Option<Command>,
#[arg(short, long)]
pub config: Option<String>,
#[arg(short, long)]
pub local_protos: bool,
}
#[derive(Debug, Subcommand)]
pub enum Command {
Check,
#[command(aliases = ["setup", "install"])]
Init,
}
#[must_use]
pub fn parse() -> Args {
let args = Args::parse();
match args.command {
Some(Command::Check) => {
let _ = setup(true, &args);
}
Some(Command::Init) => {
install();
}
None => {}
}
args
}