Skip to content

Commit c5a62d4

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 797abf0 commit c5a62d4

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
@@ -3118,6 +3118,7 @@ nvm() {
31183118
nvm_echo ' nvm ls-remote [<version>] List remote versions available for install, matching a given <version> if provided'
31193119
nvm_echo ' --lts When listing, only show LTS (long-term support) versions'
31203120
nvm_echo ' --lts=<LTS name> When listing, only show versions for a specific LTS line'
3121+
nvm_echo ' --min=<version> When listing, only show versions greater than or equal to <version>, including minor/patch updates for installed versions'
31213122
nvm_echo ' --no-colors Suppress colored output'
31223123
nvm_echo ' nvm version <version> Resolve the given description to a single local version'
31233124
nvm_echo ' nvm version-remote <version> Resolve the given description to a single remote version'
@@ -4134,6 +4135,7 @@ nvm() {
41344135
;;
41354136
"ls-remote" | "list-remote")
41364137
local NVM_LTS
4138+
local NVM_MIN="${NVM_MIN-}"
41374139
local PATTERN
41384140
local NVM_NO_COLORS
41394141

@@ -4146,6 +4148,9 @@ nvm() {
41464148
--lts=*)
41474149
NVM_LTS="${1##--lts=}"
41484150
;;
4151+
--min=*)
4152+
NVM_MIN="${1##--min=}"
4153+
;;
41494154
--no-colors) NVM_NO_COLORS="${1}" ;;
41504155
--*)
41514156
nvm_err "Unsupported option \"${1}\"."

0 commit comments

Comments
 (0)