Skip to content

Commit e039847

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 f8fdde6 commit e039847

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
@@ -3076,6 +3076,7 @@ nvm() {
30763076
nvm_echo ' nvm ls-remote [<version>] List remote versions available for install, matching a given <version> if provided'
30773077
nvm_echo ' --lts When listing, only show LTS (long-term support) versions'
30783078
nvm_echo ' --lts=<LTS name> When listing, only show versions for a specific LTS line'
3079+
nvm_echo ' --min=<version> When listing, only show versions greater than or equal to <version>, including minor/patch updates for installed versions'
30793080
nvm_echo ' --no-colors Suppress colored output'
30803081
nvm_echo ' nvm version <version> Resolve the given description to a single local version'
30813082
nvm_echo ' nvm version-remote <version> Resolve the given description to a single remote version'
@@ -4070,6 +4071,7 @@ nvm() {
40704071
;;
40714072
"ls-remote" | "list-remote")
40724073
local NVM_LTS
4074+
local NVM_MIN="${NVM_MIN-}"
40734075
local PATTERN
40744076
local NVM_NO_COLORS
40754077

@@ -4082,6 +4084,9 @@ nvm() {
40824084
--lts=*)
40834085
NVM_LTS="${1##--lts=}"
40844086
;;
4087+
--min=*)
4088+
NVM_MIN="${1##--min=}"
4089+
;;
40854090
--no-colors) NVM_NO_COLORS="${1}" ;;
40864091
--*)
40874092
nvm_err "Unsupported option \"${1}\"."

0 commit comments

Comments
 (0)