summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorNamilskyy <alive6863@gmail.com>2025-11-28 16:53:04 +0300
committerNamilskyy <alive6863@gmail.com>2025-11-28 16:53:04 +0300
commit8f36d09022e20a51e9fe9d883511a0ec8024d5e2 (patch)
tree2fd0c22f90cfaabfc4828a0766036e0c5e153a4e /src/main.rs
parent997d87c3f246d520398273ff150e10d6569250ba (diff)
Some fixes and debug
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs40
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