diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 9a0d103..4515896 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,22 +16,31 @@ struct Cli { #[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, @@ -40,6 +49,33 @@ struct RemoteInstallArgs { I2P: bool, } -fn main() { - +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(()) }
\ No newline at end of file |
