diff --git a/src/commands/uninstall.rs b/src/commands/uninstall.rs index 1436146..c9a6772 100644 --- a/src/commands/uninstall.rs +++ b/src/commands/uninstall.rs @@ -1,8 +1,17 @@ use crate::utils::{helpers, node}; use helpers::Result; -pub fn run(name: Vec, global: bool) -> Result<()> { - node::uninstall(&name, global); +pub fn run(packages: Vec, global: bool) -> Result<()> { + let packages = packages + .iter() + // Filter out any flags + // This can happen when passing args using `--` + // For example: `supreme install is-even -- -W` + .filter(|p| !p.starts_with('-')) + .map(|p| p.to_string()) + .collect::>(); + + node::uninstall(&packages, global); Ok(()) }