From 3ad81e7cc52fa707d122b94bfea853e22513bcd6 Mon Sep 17 00:00:00 2001 From: ryenus Date: Sun, 14 Jul 2024 18:43:55 +0800 Subject: [PATCH] ls-remote: add CLI option --min= When omitted, fallback to the environment variable "NVM_MIN" if set. And the CLI option --min= take precedence over the environment variable "NVM_MIN" if both are present. --- nvm.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvm.sh b/nvm.sh index 83194ffbd95..228e331bd89 100644 --- a/nvm.sh +++ b/nvm.sh @@ -3036,6 +3036,7 @@ nvm() { nvm_echo ' nvm ls-remote [] List remote versions available for install, matching a given if provided' nvm_echo ' --lts When listing, only show LTS (long-term support) versions' nvm_echo ' --lts= When listing, only show versions for a specific LTS line' + nvm_echo ' --min= When listing, only show versions greater than or equal to , including minor/patch updates for installed versions' nvm_echo ' --no-colors Suppress colored output' nvm_echo ' nvm version Resolve the given description to a single local version' nvm_echo ' nvm version-remote Resolve the given description to a single remote version' @@ -4012,6 +4013,7 @@ nvm() { ;; "ls-remote" | "list-remote") local NVM_LTS + local NVM_MIN="${NVM_MIN-}" local PATTERN local NVM_NO_COLORS @@ -4024,6 +4026,9 @@ nvm() { --lts=*) NVM_LTS="${1##--lts=}" ;; + --min=*) + NVM_MIN="${1##--min=}" + ;; --no-colors) NVM_NO_COLORS="${1}" ;; --*) nvm_err "Unsupported option \"${1}\"."