Details
Description
$@ is always word-split, even inside doublequotes. Hence line 83:
if [ "x$@" = "xdebug" ]; then
throws a shell syntax error (in bash "too many arguments", in BSD sh "unexpected operator" ) if the script is given multiple arguments (such as those documented in README.txt) because "x$@" is expanded to x$1 $2 [...] $n NOT "x$1 $2 [...] $n"
The cleanest fix is to change line 83 to:
if [ "$1" = "debug" ]; then
This is a precise check for whether the first argument to the script is "debug" and clearly that's the only relevant argument in such a case, as the "then" clause causes any other args to be ignored.