Making `help` error output actually output to stderr consistently.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Jordan Harband · committed by Jordan Harband · parent 5802ac3 · Browse files · 1 file·+16 added−14 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+16 added−14 removed
- other:+16 added−14 removed
Provenance
- Commit
230b479- Tree
3f07a57- Author
Jordan Harband <ljharb@gmail.com>- Committer
Jordan Harband <ljharb@gmail.com>- Parent
5802ac3
1 file changed+16 added−14 removed
modified:nvm.sh+16 added-14 removed
1110 unmodified lines1111 if [ $# -lt 2 ]; then1112 version_not_provided=11113 nvm_rc_version1114 if [ -z "$NVM_RC_VERSION" ]; then1115- nvm help1116- return1115+ >&2 nvm help1116+ return 1271117 fi1118 fi1119 1120 shift96 unmodified lines1217 nvm_install_node_source "$VERSION" "$REINSTALL_PACKAGES_FROM" "$ADDITIONAL_PARAMETERS"1218 fi1219 ;;1220 "uninstall" )1221- [ $# -ne 2 ] && nvm help && return1221+ if [ $# -ne 2 ]; then1222+ >&2 nvm help1223+ return 1271224+ fi1225 1226 local PATTERN1227 PATTERN="$2"1228 case "_$PATTERN" in71 unmodified lines1300 echo "$NVM_DIR/*/lib/node_modules removed from \$NODE_PATH"1301 fi1302 ;;1303 "use" )1301- if [ $# -eq 0 ]; then1302- nvm help1303- return 1271304- fi1305-1304 local PROVIDED_VERSION1305 if [ $# -eq 1 ]; then1306 nvm_rc_version1307 if [ -n "$NVM_RC_VERSION" ]; then19 unmodified lines1327 esac1328 fi1329 1330 if [ -z "$VERSION" ]; then1333- nvm help1331+ >&2 nvm help1332 return 1271333 fi1334 1335 if [ "_$VERSION" = '_system' ]; then61 unmodified lines1397 else1398 VERSION='N/A'1399 fi1400 if [ $VERSION = "N/A" ]; then1403- nvm help1401+ >&2 nvm help1402 return 1271403 fi1404 fi1405 140 unmodified lines1546 else1547 VERSION="$2"1548 fi1549 if [ -z "$VERSION" ]; then1552- nvm help1550+ >&2 nvm help1551 return 1271552 fi1553 1554 if [ "_$VERSION" = '_system' ]; then75 unmodified lines1630 "unalias" )1631 local NVM_ALIAS_DIR1632 NVM_ALIAS_DIR="$(nvm_alias_path)"1633 command mkdir -p "$NVM_ALIAS_DIR"1636- [ $# -ne 2 ] && nvm help && return 1271634+ if [ $# -ne 2 ]; then1635+ >&2 nvm help1636+ return 1271637+ fi1638 [ ! -f "$NVM_ALIAS_DIR/$2" ] && echo "Alias $2 doesn't exist!" >&2 && return1639 command rm -f "$NVM_ALIAS_DIR/$2"1640 echo "Deleted alias $2"1641 ;;1642 "reinstall-packages" | "copy-packages" )1643 if [ $# -ne 2 ]; then1643- nvm help1644+ >&2 nvm help1645 return 1271646 fi1647 1648 local PROVIDED_VERSION41 unmodified lines1690 nvm_supports_source_options > /dev/null 2>&11691 unset RC_VERSION NVM_NODEJS_ORG_MIRROR NVM_DIR NVM_CD_FLAGS > /dev/null 2>&11692 ;;1693 * )1693- nvm help1694+ >&2 nvm help1695+ return 1271696 ;;1697 esac1698 }1699 17 unmodified lines