Merge pull request #1757 from atom/cj-shhhhh

Don't show error messages for version and help cli options
This commit is contained in:
Corey Johnson
2014-03-13 17:42:19 -07:00
2 changed files with 15 additions and 3 deletions

16
atom.sh
View File

@@ -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 $?

View File

@@ -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.')