Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:

  # initialize local variables
  local VERSION
  local ADDITIONAL_PARAMETERS

  case $COMMAND in
    'help' | '--help')
      local NVM_IOJS_PREFIX
      NVM_IOJS_PREFIX="$(nvm_iojs_prefix)"
      local NVM_NODE_PREFIX
      NVM_NODE_PREFIX="$(nvm_node_prefix)"
      # local NVM_NO_COLOR
      local GREENVERSION
      if [ -z "${NVM_NO_COLORS-}" ] && nvm_has_colors; then
        NVM_HAS_COLORS=1
      fi
      NVM_VERSION="$(nvm --version)"
      if [ "${NVM_HAS_COLORS-}" = '1' ]; then
        GREENVERSION='\033[0;32m%s\033[0m\n'
      else
        GREENVERSION=' %12s *'
      fi
      nvm_echo
      nvm_echo "Node Version Manager"
      nvm_echo
      command printf -- "NVM Version : ${GREENVERSION}" "${NVM_VERSION}"
      nvm_echo
      nvm_echo 'Note: <version> refers to any version-like string nvm understands. This includes:'
      nvm_echo '  - full or partial version numbers, starting with an optional "v" (0.10, v0.1.2, v1)'
      nvm_echo "  - default (built-in) aliases: ${NVM_NODE_PREFIX}, stable, unstable, ${NVM_IOJS_PREFIX}, system"
      nvm_echo '  - custom aliases you define with `nvm alias foo`'
      nvm_echo
      nvm_echo ' Any options that produce colorized output should respect the `--no-colors` option.'
      nvm_echo
      nvm_echo 'Usage:'
      nvm_echo '  nvm --help                                Show this message'
      nvm_echo '  nvm --version                             Print out the installed version of nvm'
      nvm_echo
      nvm_echo '  nvm install [-s] <version>                Download and install a <version>, [-s] from source. Uses .nvmrc if available'
      nvm_echo '    --reinstall-packages-from=<version>     When installing, reinstall packages installed in <node|iojs|node version number>'
      nvm_echo '    --lts                                   When installing, only select from LTS (long-term support) versions'
      nvm_echo '    --lts=<LTS name>                        When installing, only select from versions for a specific LTS line'
      nvm_echo '    --skip-default-packages                 When installing, skip the default-packages file if it exists'
      nvm_echo '    --latest-npm                            After installing, attempt to upgrade to the latest working npm on the given node version'
      nvm_echo '    --no-progress                           Disable the progress bar on any downloads'
      nvm_echo
      nvm_echo '  nvm uninstall <version>                   Uninstall a version'
      nvm_echo '  nvm uninstall --lts                       Uninstall using automatic LTS (long-term support) alias `lts/*`, if available.'
      nvm_echo '  nvm uninstall --lts=<LTS name>            Uninstall using automatic alias for provided LTS line, if available.'
      nvm_echo
      nvm_echo '  nvm use [--silent] <version>              Modify PATH to use <version>. Uses .nvmrc if available'

Review comment (suggestion):
nvm is always lowercased:
```suggestion
      command printf -- "nvm version : ${GREENVERSION}" "${NVM_VERSION}"
```

Code after:
    return $EXIT_CODE
  elif [ "${IFS}" != "${DEFAULT_IFS}" ]; then
    IFS="${DEFAULT_IFS}" nvm "$@"
    return $?
  fi

  local COMMAND
  COMMAND="${1-}"
  shift

  # initialize local variables
  local VERSION
  local ADDITIONAL_PARAMETERS

  case $COMMAND in
    'help' | '--help')
      local NVM_IOJS_PREFIX
      NVM_IOJS_PREFIX="$(nvm_iojs_prefix)"
      local NVM_NODE_PREFIX
      NVM_NODE_PREFIX="$(nvm_node_prefix)"
      NVM_VERSION="$(nvm --version)"
      nvm_echo
      nvm_echo "Node Version Manager (v${NVM_VERSION})"
      nvm_echo
      nvm_echo 'Note: <version> refers to any version-like string nvm understands. This includes:'
      nvm_echo '  - full or partial version numbers, starting with an optional "v" (0.10, v0.1.2, v1)'
      nvm_echo "  - default (built-in) aliases: ${NVM_NODE_PREFIX}, stable, unstable, ${NVM_IOJS_PREFIX}, system"
      nvm_echo '  - custom aliases you define with `nvm alias foo`'
      nvm_echo
      nvm_echo ' Any options that produce colorized output should respect the `--no-colors` option.'
      nvm_echo
      nvm_echo 'Usage:'
      nvm_echo '  nvm --help                                Show this message'
      nvm_echo '  nvm --version                             Print out the installed version of nvm'
      nvm_echo '  nvm install [-s] <version>                Download and install a <version>, [-s] from source. Uses .nvmrc if available'
      nvm_echo '    --reinstall-packages-from=<version>     When installing, reinstall packages installed in <node|iojs|node version number>'
      nvm_echo '    --lts                                   When installing, only select from LTS (long-term support) versions'
      nvm_echo '    --lts=<LTS name>                        When installing, only select from versions for a specific LTS line'
      nvm_echo '    --skip-default-packages                 When installing, skip the default-packages file if it exists'
      nvm_echo '    --latest-npm                            After installing, attempt to upgrade to the latest working npm on the given node version'
      nvm_echo '    --no-progress                           Disable the progress bar on any downloads'
      nvm_echo '  nvm uninstall <version>                   Uninstall a version'
      nvm_echo '  nvm uninstall --lts                       Uninstall using automatic LTS (long-term support) alias `lts/*`, if available.'
      nvm_echo '  nvm uninstall --lts=<LTS name>            Uninstall using automatic alias for provided LTS line, if available.'
      nvm_echo '  nvm use [--silent] <version>              Modify PATH to use <version>. Uses .nvmrc if available'
      nvm_echo '    --lts                                   Uses automatic LTS (long-term support) alias `lts/*`, if available.'
      nvm_echo '    --lts=<LTS name>                        Uses automatic alias for provided LTS line, if available.'
      nvm_echo '  nvm exec [--silent] <version> [<command>] Run <command> on <version>. Uses .nvmrc if available'
      nvm_echo '    --lts                                   Uses automatic LTS (long-term support) alias `lts/*`, if available.'
      nvm_echo '    --lts=<LTS name>                        Uses automatic alias for provided LTS line, if available.'
      nvm_echo '  nvm run [--silent] <version> [<args>]     Run `node` on <version> with <args> as arguments. Uses .nvmrc if available'