Skip to content

Commit

Permalink
ls-remote: add CLI option --min=<version>
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryenus committed Aug 8, 2024
1 parent f8fdde6 commit e039847
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3076,6 +3076,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'
Expand Down Expand Up @@ -4070,6 +4071,7 @@ nvm() {
;;
"ls-remote" | "list-remote")
local NVM_LTS
local NVM_MIN="${NVM_MIN-}"
local PATTERN
local NVM_NO_COLORS

Expand All @@ -4082,6 +4084,9 @@ nvm() {
--lts=*)
NVM_LTS="${1##--lts=}"
;;
--min=*)
NVM_MIN="${1##--min=}"
;;
--no-colors) NVM_NO_COLORS="${1}" ;;
--*)
nvm_err "Unsupported option \"${1}\"."
Expand Down

0 comments on commit e039847

Please sign in to comment.