add CLI option --min=<version>, fallback to env var "NVM_MIN" if set.
The latter two pick the newest match,
which is below the minimum only when every match is,
so they check the resolved version.
`ls-remote` prints its notice on stderr, so the list stays parseable.
Other minor changes:
- fix: disable color in nvm_print_versions tests
- trim leading space in mock output due to eslint errors
- ensure prefixed versions like v18 also work
- remove function ref duplication
- avoid inline initialization for ksh compatibility
- apply `--min=` before checking for an empty list; require a version
Co-authored-by: ryenus <ryenus@gmail.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
No need to escape the `/` char in a grep pattern.
This is to fix the below error when using newer grep with `nvm_command_info`
> $ nvm_command_info curl
> grep: warning: stray \ before /
> /usr/bin/curl
This happens with at least GNU grep 3.8 version.