you need something like [semver](https://github.com/isaacs/node-semver) for the command line, with a compare function.