jasongin / nvs

Node Version Switcher - A cross-platform tool for switching between versions and forks of Node.js
Other
2.71k stars 210 forks source link

nvs rm multiple versions #51

Open brodycj opened 7 years ago

brodycj commented 7 years ago

When I tried nvs rm with multiple version numbers it only removed the first one and ignored the rest.

It would be better for nvs rm to show an error message in this case.

It would be even better for nvs rm to support multiple version numbers.

As a general note I would like to thanks @jasongin again for such nice work. I am really happy to have it all work the same way on macOS & Windows and have abandoned the other Node version managers.

brodycj commented 7 years ago

Also if I do something like nvs rm boron it only removes the latest Boron version and leaves the others in place. For example:

C:\Users\Chris
λ nvs ls
  node/6.10.2/x64 (Boron)
  node/6.10.1/x64 (Boron)
 >node/4.8.3/x64 (Argon)

C:\Users\Chris
λ nvs rm boron
- C:\Users\Chris\nvs\node\6.10.2\x64

C:\Users\Chris
λ nvs ls
  node/6.10.1/x64 (Boron)
 >node/4.8.3/x64 (Argon)
jasongin commented 7 years ago

It would be better for nvs rm to show an error message in this case.

Agreed. This is a general issue with all commands. Instead of ignoring additional unsupported/invalid arguments they should print an error and command usage help.

It would be even better for nvs rm to support multiple version numbers.

Maybe. I could imagine both nvs add and nvs rm accepting multiple version arguments. But it seems like not a big deal when it's easy enough to use multiple commands instead.

if I do something like nvs rm boron it only removes the latest Boron version and leaves the others in place

For all nvs commands, when an LTS tag (such as "boron") or partial version (such as "6") matches multiple available versions, then the latest matching version is selected. I'd be concerned that having nvs rm affect all matching versions instead of just the latest would be unexpected, since it would be inconsistent with other commands. Maybe there could be an option to match all? Something like: nvs rm -a boron