mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-10-30 17:25:51 +08:00
[New] nvm ls: add --no-alias to suppress alias output
Per https://github.com/creationix/nvm/issues/1792#issuecomment-466696504
This commit is contained in:
15
test/fast/Listing versions/Running "nvm ls --no-alias" with a pattern errors
Executable file
15
test/fast/Listing versions/Running "nvm ls --no-alias" with a pattern errors
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
\. ../../../nvm.sh
|
||||
\. ../../common.sh
|
||||
|
||||
die () { echo "$@" ; unset -f nvm_ls nvm_list_aliases; exit 1; }
|
||||
|
||||
set -e
|
||||
|
||||
OUTPUT="$(nvm ls --no-colors --no-alias pattern 2>&1 ||:)"
|
||||
EXPECTED_OUTPUT='`--no-alias` is not supported when a pattern is provided.'
|
||||
EXIT_CODE="$(nvm ls --no-colors --no-alias pattern >/dev/null 2>&1 || echo $?)"
|
||||
[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "expected >${EXPECTED_OUTPUT}<; got >${OUTPUT}<"
|
||||
|
||||
[ "${EXIT_CODE}" = 55 ] || die "expected 55; got >${EXIT_CODE}<"
|
||||
Reference in New Issue
Block a user