Repository: alloy-rs/svm-rs (language: rust)

Issue:
`svm install <version>` and `svm list` failures
The following functions from the README fail:

> -   List available versions
> 
> ```sh
> svm list
> ```
> 
> -   Install a version
> 
> ```sh
> svm install <version>
> ```

![image](https://github.com/alloy-rs/svm-rs/assets/22738317/1f36ba37-6ee8-46ad-8fe7-9fb506797c33)

Installation was from source via `cargo install --locked --git https://github.com/roynalnaruto/svm-rs`



Discussion / hints:

Fix patch:
diff --git a/crates/svm-rs/src/bin/svm-bin/install.rs b/crates/svm-rs/src/bin/svm-bin/install.rs
index fd0daf0..5c1a160 100644
--- a/crates/svm-rs/src/bin/svm-bin/install.rs
+++ b/crates/svm-rs/src/bin/svm-bin/install.rs
@@ -3,9 +3,9 @@ use clap::Parser;
 use dialoguer::Input;
 use semver::Version;
 
-#[derive(Debug, Clone, Parser)]
+#[derive(Debug, Clone, PartialEq, Eq, Parser)]
 pub struct InstallArgs {
-    #[clap(long, short)]
+    /// Solc versions to install
     pub versions: Vec<String>,
 }
 
@@ -45,3 +45,19 @@ impl InstallArgs {
         Ok(())
     }
 }
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn parse_install() {
+        let args: InstallArgs = InstallArgs::parse_from(["svm", "0.8.11", "0.8.10"]);
+        assert_eq!(
+            args,
+            InstallArgs {
+                versions: vec!["0.8.11".into(), "0.8.10".into()]
+            }
+        );
+    }
+}
diff --git a/crates/svm-rs/src/bin/svm-bin/main.rs b/crates/svm-rs/src/bin/svm-bin/main.rs
index 8925c6f..049f086 100644
--- a/crates/svm-rs/src/bin/svm-bin/main.rs
+++ b/crates/svm-rs/src/bin/svm-bin/main.rs
@@ -33,10 +33,10 @@ async fn main() -> anyhow::Result<()> {
     svm_lib::setup_data_dir()?;
 
     match opt {
-        SolcVm::List(cmd) => utils::block_on(cmd.run())?,
-        SolcVm::Install(cmd) => utils::block_on(cmd.run())?,
-        SolcVm::Use(cmd) => utils::block_on(cmd.run())?,
-        SolcVm::Remove(cmd) => utils::block_on(cmd.run())?,
+        SolcVm::List(cmd) => cmd.run().await?,
+        SolcVm::Install(cmd) => cmd.run().await?,
+        SolcVm::Use(cmd) => cmd.run().await?,
+        SolcVm::Remove(cmd) => cmd.run().await?,
     }
 
     Ok(())
diff --git a/crates/svm-rs/src/bin/svm-bin/remove.rs b/crates/svm-rs/src/bin/svm-bin/remove.rs
index b96bae0..df772db 100644
--- a/crates/svm-rs/src/bin/svm-bin/remove.rs
+++ b/crates/svm-rs/src/bin/svm-bin/remove.rs
@@ -5,8 +5,7 @@ use semver::Version;
 
 #[derive(Debug, Clone, Parser)]
 pub struct RemoveArgs {
-    #[clap(long, short)]
-    // TODO: Serde helper for parsing Version(?)
+    /// Solc version to remove
     pub version: String,
 }
 
diff --git a/crates/svm-rs/src/bin/svm-bin/usev.rs b/crates/svm-rs/src/bin/svm-bin/usev.rs
index cb432b1..722af84 100644
--- a/crates/svm-rs/src/bin/svm-bin/usev.rs
+++ b/crates/svm-rs/src/bin/svm-bin/usev.rs
@@ -5,7 +5,7 @@ use semver::Version;
 
 #[derive(Debug, Clone, Parser)]
 pub struct UseArgs {
-    #[clap(long, short)]
+    /// Solc version to use
     pub version: String,
 }
 


Test patch: