diff --git a/atom.sh b/atom.sh index b2cf5e5a7..dfa55ab93 100755 --- a/atom.sh +++ b/atom.sh @@ -9,7 +9,7 @@ if [ ! -d $ATOM_PATH ]; then exit 1 fi -while getopts ":whvft-:" opt; do +while getopts ":whvfts-:" opt; do case "$opt" in -) case "${OPTARG}" in diff --git a/src/atom-application.coffee b/src/atom-application.coffee index a4f019dcb..7fafa5c95 100644 --- a/src/atom-application.coffee +++ b/src/atom-application.coffee @@ -51,7 +51,7 @@ class AtomApplication resourcePath: null version: null - constructor: ({@resourcePath, pathsToOpen, urlsToOpen, @version, test, pidToKillWhenClosed, devMode, newWindow}) -> + constructor: ({@resourcePath, pathsToOpen, urlsToOpen, @version, test, pidToKillWhenClosed, devMode, newWindow, specDirectory}) -> global.atomApplication = this @pidsToOpenWindows = {} @@ -67,7 +67,7 @@ class AtomApplication @checkForUpdates() if test - @runSpecs({exitWhenDone: true, @resourcePath}) + @runSpecs({exitWhenDone: true, @resourcePath, specDirectory}) else if pathsToOpen.length > 0 @openPaths({pathsToOpen, pidToKillWhenClosed, newWindow, devMode}) else if urlsToOpen.length > 0 diff --git a/src/main.coffee b/src/main.coffee index 2e42f9888..061669726 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -76,11 +76,12 @@ parseCommandLine = -> Usage: atom [options] [file ...] """ options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.') + options.alias('f', 'foreground').boolean('f').describe('f', 'Keep the browser process in the foreground.') options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.') options.alias('n', 'new-window').boolean('n').describe('n', 'Open a new window.') - options.alias('t', 'test').boolean('t').describe('t', 'Run the Atom specs and exit with error code on failures.') + options.alias('s', 'spec-directory').string('s').describe('s', 'Set the directory from which specs are loaded (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('f', 'foreground').boolean('f').describe('f', 'Keep the browser process in the foreground.') options.alias('w', 'wait').boolean('w').describe('w', 'Wait for window to be closed before returning.') args = options.argv @@ -97,6 +98,7 @@ parseCommandLine = -> pathsToOpen = args._ pathsToOpen = [executedFrom] if executedFrom and pathsToOpen.length is 0 test = args['test'] + specDirectory = args['spec-directory'] newWindow = args['new-window'] pidToKillWhenClosed = args['pid'] if args['wait'] @@ -112,4 +114,4 @@ parseCommandLine = -> devMode = false resourcePath = path.dirname(__dirname) - {resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, devMode, newWindow} + {resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, devMode, newWindow, specDirectory}