Skip to content

Commit ceff60c

Browse files
committed
ls-remote: add CLI option --min=<version>
When omitted, fallback to the environment variable "NVM_MIN" if set. And the CLI option --min=<version> takes precedence over the environment variable "NVM_MIN" if both are present.
1 parent 56142b4 commit ceff60c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nvm.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,6 +3072,7 @@ nvm() {
30723072
nvm_echo ' nvm ls-remote [<version>] List remote versions available for install, matching a given <version> if provided'
30733073
nvm_echo ' --lts When listing, only show LTS (long-term support) versions'
30743074
nvm_echo ' --lts=<LTS name> When listing, only show versions for a specific LTS line'
3075+
nvm_echo ' --min=<version> When listing, only show versions greater than or equal to <version>, including minor/patch updates for installed versions'
30753076
nvm_echo ' --no-colors Suppress colored output'
30763077
nvm_echo ' nvm version <version> Resolve the given description to a single local version'
30773078
nvm_echo ' nvm version-remote <version> Resolve the given description to a single remote version'
@@ -4060,6 +4061,7 @@ nvm() {
40604061
;;
40614062
"ls-remote" | "list-remote")
40624063
local NVM_LTS
4064+
local NVM_MIN="${NVM_MIN-}"
40634065
local PATTERN
40644066
local NVM_NO_COLORS
40654067

@@ -4072,6 +4074,9 @@ nvm() {
40724074
--lts=*)
40734075
NVM_LTS="${1##--lts=}"
40744076
;;
4077+
--min=*)
4078+
NVM_MIN="${1##--min=}"
4079+
;;
40754080
--no-colors) NVM_NO_COLORS="${1}" ;;
40764081
--*)
40774082
nvm_err "Unsupported option \"${1}\"."

0 commit comments

Comments
 (0)