use std::path::PathBuf; use clap::{Parser, Subcommand}; use color_eyre::Result; static USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); #[derive(Debug, Parser)] #[command(author, version, about, long_about = None)] #[command(propagate_version = true)] struct Cli { #[command(subcommand)] command: Commands, } #[derive(Clone, Debug, Subcommand)] enum Commands { Pr { #[command(subcommand)] action: Action, }, Package { #[command(subcommand)] action: Action, }, Status { #[command(subcommand)] action: Action, }, } #[derive(Clone, Debug, Subcommand)] pub(crate) enum Action { Check, In { dest: PathBuf }, Out { src: PathBuf }, } mod types; mod util; mod cmd { pub mod package; pub mod pr; pub mod status; } fn main() -> Result<()> { color_eyre::install()?; let cli = Cli::parse(); match &cli.command { Commands::Pr { action } => cmd::pr::run(action), Commands::Package { action } => cmd::package::run(action), Commands::Status { action } => cmd::status::run(action), } }