Skip to content

Commit

Permalink
list command properly takes in multiple libs
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjamuffin99 committed Jan 15, 2025
1 parent 80f4bff commit 3d3b994
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions src/hmm/dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ impl fmt::Display for Dependancies {
}

impl Dependancies {
pub fn print_string_list(&self, lib: &Option<String>) -> Result<()> {
if let Some(lib) = lib {
let haxelib = Self::get_haxelib(self, lib)?;
Self::print_haxelib(&haxelib);
pub fn print_string_list(&self, libs: &Option<Vec<String>>) -> Result<()> {
if let Some(libs) = libs {
for lib in libs {
let haxelib = Self::get_haxelib(self, lib)?;
Self::print_haxelib(&haxelib);
}

return Ok(());
}

Expand Down
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ enum Commands {
/// Lists the dependencies in the hmm.json file (or a file of your choice with --path)
/// use `hmm-rs check` to see if the dependencies are installed at the correct versions
List {
#[arg(short, long)]
lib: Option<String>,
/// Specific libraries you want to list, can be multiple
/// `hmm-rs list lime openfl` will list lime and openfl
#[arg(value_name = "LIBS")]
lib: Option<Vec<String>>,
},
/// Creates an empty .haxelib/ folder, and an empty hmm.json file
Init,
Expand All @@ -45,9 +47,9 @@ enum Commands {
},
/// Removes one or more library dependencies from `hmm.json` and the `.haxelib/` folder
Remove {
/// The library you wish to remove
/// The library(s) you wish to remove
#[arg(short, long)]
lib: String,
lib: Vec<String>,
},
}

Expand Down

0 comments on commit 3d3b994

Please sign in to comment.