Skip to content

Commit

Permalink
Exit with non-zero status code (code = 2) on invalid command line usage.
Browse files Browse the repository at this point in the history
Fixes #45.
  • Loading branch information
Kami committed Dec 4, 2013
1 parent 780dbbe commit addd91c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ function run(cwd, argv) {

}
else if (!p._halted) {
exports.exitCode = 2;
console.log(p.banner);
}

Expand Down
8 changes: 8 additions & 0 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ echo " ||----w |"
echo " || ||"
sleep 0.5

$W > /tmp/output 2>&1

if [ $? -ne 2 ]; then
echo "Invalid usage, but didn't exit with non-zero"
exit 1
fi

$W -g ./example/global-setup.js ${ANY_SUITE} >/tmp/output 2>&1

if [ $? -ne 0 ]; then
echo "-g/--global-setup-teardown must base its paths from the invoking CWD"
exit 1
Expand Down

0 comments on commit addd91c

Please sign in to comment.