use crate::package::identifier::PackageIdentifier; use clap::{Parser, Subcommand}; use log::error; #[derive(Parser, Debug)] #[clap(name = "pkgr", version = "0.1.0", author = "")] pub struct Cli { #[command(subcommand)] pub command: Command, } #[derive(Subcommand, Debug)] pub enum Command { /// Install a package Install { #[arg(short, long, default_value_t = false)] build: bool, package_identifier: PackageIdentifier, }, /// Remove a package from the system Remove { package_identifier: PackageIdentifier, }, /// List packages List { /// List installed packages #[arg(short, long, default_value_t = true)] installed: bool, }, /// Update packages on the system Update, #[command(hide = true)] None, } impl Command { pub fn execute(&self) { match self { Command::Install { build, package_identifier: _, } => { if *build { error!("Build is not yet implemented."); } else { error!("Install is not yet implemented."); } } Command::Remove { package_identifier: _ } => { error!("Remove is not yet implemented."); } Command::List { installed: _ } => { error!("List is not yet implemented."); } Command::Update => { error!("Update is not yet implemented."); } Command::None => { error!("No command was specified."); } } } }