Compare commits

...

2 Commits

Author SHA1 Message Date
ryenus
2ff58fa0fc
Merge df9ec5851271f550f2af4b7d23705d78c901f881 into 762f9ef9d17623b45095e8ca1a996c8928f3f424 2024-07-14 11:37:31 +00:00
ryenus
df9ec58512 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.
2024-07-14 19:37:18 +08:00

5
nvm.sh
View File

@ -3036,6 +3036,7 @@ nvm() {
nvm_echo ' nvm ls-remote [<version>] List remote versions available for install, matching a given <version> if provided'
nvm_echo ' --lts When listing, only show LTS (long-term support) versions'
nvm_echo ' --lts=<LTS name> When listing, only show versions for a specific LTS line'
nvm_echo ' --min=<version> When listing, only show versions greater than or equal to <version>, including minor/patch updates for installed versions'
nvm_echo ' --no-colors Suppress colored output'
nvm_echo ' nvm version <version> Resolve the given description to a single local version'
nvm_echo ' nvm version-remote <version> 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}\"."