diff --git a/atom.sh b/atom.sh index f5672d6eb7f..d844a946ad0 100755 --- a/atom.sh +++ b/atom.sh @@ -20,7 +20,11 @@ while getopts ":wtfvhs-:" opt; do wait) WAIT=1 ;; - help|version|foreground|test) + help|version) + REDIRECT_STDERR=1 + EXPECT_OUTPUT=1 + ;; + foreground|test) EXPECT_OUTPUT=1 ;; esac @@ -28,12 +32,20 @@ while getopts ":wtfvhs-:" opt; do w) WAIT=1 ;; - h|v|f|t) + h|v) + REDIRECT_STDERR=1 + EXPECT_OUTPUT=1 + ;; + f|t) EXPECT_OUTPUT=1 ;; esac done +if [ $REDIRECT_STDERR ]; then + exec 2> /dev/null +fi + if [ $EXPECT_OUTPUT ]; then "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/Atom" --executed-from="$(pwd)" --pid=$$ "$@" exit $? diff --git a/src/browser/main.coffee b/src/browser/main.coffee index 45862847509..cd3483dd01f 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -77,7 +77,7 @@ parseCommandLine = -> options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.') options.alias('l', 'log-file').string('l').describe('l', 'Log all output to file.') options.alias('n', 'new-window').boolean('n').describe('n', 'Open a new window.') - options.alias('s', 'spec-directory').string('s').describe('s', 'Set the directory from which specs are loaded (default: Atom\'s spec directory).') + options.alias('s', 'spec-directory').string('s').describe('s', 'Set the spec directory (default: Atom\'s spec directory).') options.alias('t', 'test').boolean('t').describe('t', 'Run the specified specs and exit with error code on failures.') options.alias('v', 'version').boolean('v').describe('v', 'Print the version.') options.alias('w', 'wait').boolean('w').describe('w', 'Wait for window to be closed before returning.')