mod cfg; mod i2impl; mod pkgtoolkit; use crate::cfg::config::Config; use crate::pkgtoolkit::pkgtools::Package; use crate::i2impl::mi2p; use clap::{Parser, Subcommand, Args}; #[derive(Parser)] struct Cli { #[command(subcommand)] command: Commands, } #[derive(Subcommand)] enum Commands { #[command(about = "Validate .mesk package archive")] Validate { pkgname: String, }, #[command(about = "Build package from .mesk ")] Build{ pkgname: String, }, #[command(about = "Install package from remote or local sources")] Install{ pkgname: String, }, #[command(about = "Uninstall package")] Uninstall{ pkgname: String, }, #[command(about = "Get package source")] GetSource{ pkgname: String } } #[derive(Args, Clone)] #[command(about = "Remote install arguments")] struct RemoteInstallArgs { Verbose: bool, Debug: bool, Bin: bool, Source: bool, I2P: bool, } fn main() -> Result<(), std::io::Error> { let cli: Cli = Cli::parse(); // Plug in these functions only until the backend is ready for testing (Aplha versions) // It is necessary for me to understand the I/O model of the future mesk. match &cli.command { Commands::Validate { pkgname } => { println!("Validating {}", pkgname); return Ok(()) }, Commands::Build { pkgname } => { println!("Building {}", pkgname); return Ok(()) }, Commands::Install { pkgname } => { println!("Installing {}", pkgname); return Ok(()) }, Commands::Uninstall { pkgname } => { println!("Uninstalling {}", pkgname); return Ok(()) }, Commands::GetSource { pkgname } => { println!("Getting source of {}", pkgname); return Ok(()) } } Ok(()) }