Skip to content

Commit

Permalink
Merge pull request atom#1757 from atom/cj-shhhhh
Browse files Browse the repository at this point in the history
Don't show error messages for version and help cli options
  • Loading branch information
Corey Johnson committed Mar 14, 2014
2 parents 6c93ca0 + 15c51b4 commit 96e96c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions atom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,32 @@ 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
;;
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 $?
Expand Down
2 changes: 1 addition & 1 deletion src/browser/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down

0 comments on commit 96e96c3

Please sign in to comment.