Browse Source

[Fix] `exec`: `--` should stop argument parsing

Co-authored-by: Vesa Vilhonen <vesa@vilhonen.com>
Co-authored-by: Sladyn Nunes <sladynnunes98@gmail.com>
Vesa Vilhonen 4 years ago committed by Jordan Harband
parent
commit
52f67b3677
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
  1. 1
      nvm.sh
  2. 9
      test/slow/nvm exec/Running 'nvm exec' with help should not parse

1
nvm.sh

@ -2612,6 +2612,7 @@ nvm() { @@ -2612,6 +2612,7 @@ nvm() {
for i in "$@"
do
case $i in
--) break ;;
'-h'|'help'|'--help')
NVM_NO_COLORS=""
for j in "$@"; do

9
test/slow/nvm exec/Running 'nvm exec' with help should not parse

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
#!/bin/sh
die () { echo "$@" ; exit 1; }
\. ../../../nvm.sh
nvm use 0.10
nvm exec stable -- node --help | grep 'Usage: node [options]' || die "Help menu should have been displayed for node and not nvm"
Loading…
Cancel
Save