From 6ebbb58a80ab24e7bcf2b97f270e68afb28f8ddf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 3 Jun 2015 10:23:52 -0700 Subject: [PATCH 1/5] Log message about --one being removed --- atom.sh | 6 +++--- src/browser/main.coffee | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/atom.sh b/atom.sh index ecd7da052..460fdd2a8 100755 --- a/atom.sh +++ b/atom.sh @@ -11,14 +11,14 @@ else exit 1 fi -while getopts ":wtfvh-:" opt; do +while getopts ":wtfvh1-:" opt; do case "$opt" in -) case "${OPTARG}" in wait) WAIT=1 ;; - help|version) + help|version|one) REDIRECT_STDERR=1 EXPECT_OUTPUT=1 ;; @@ -30,7 +30,7 @@ while getopts ":wtfvh-:" opt; do w) WAIT=1 ;; - h|v) + h|v|1) REDIRECT_STDERR=1 EXPECT_OUTPUT=1 ;; diff --git a/src/browser/main.coffee b/src/browser/main.coffee index 5cf412808..ac6a8e6e0 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -121,8 +121,16 @@ parseCommandLine = -> 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.') options.string('socket-path') + options.alias('1', 'one').boolean('one') # Deprecated 1.0 API preview flag args = options.argv + if args.one + process.stdout.write """ + The -1/--one option has been removed. Atom now defaults to launching with + the 1.0 API. Use --include-deprecated-apis to run Atom with deprecated APIs. + + """ + if args.help process.stdout.write(options.help()) process.exit(0) From 75f2ce148a8710aefeed55f9f410fa79ca5ccb37 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 3 Jun 2015 10:28:43 -0700 Subject: [PATCH 2/5] Use consistent default format --- src/browser/main.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/main.coffee b/src/browser/main.coffee index ac6a8e6e0..0ebb13950 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -121,7 +121,7 @@ parseCommandLine = -> 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.') options.string('socket-path') - options.alias('1', 'one').boolean('one') # Deprecated 1.0 API preview flag + options.alias('1', 'one').boolean('1') # Deprecated 1.0 API preview flag args = options.argv if args.one From d965abce38e09fb8464ada40cc7efc2976c0f693 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 3 Jun 2015 11:47:49 -0700 Subject: [PATCH 3/5] Remove atom.sh -1/--one checks --- atom.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atom.sh b/atom.sh index 460fdd2a8..ecd7da052 100755 --- a/atom.sh +++ b/atom.sh @@ -11,14 +11,14 @@ else exit 1 fi -while getopts ":wtfvh1-:" opt; do +while getopts ":wtfvh-:" opt; do case "$opt" in -) case "${OPTARG}" in wait) WAIT=1 ;; - help|version|one) + help|version) REDIRECT_STDERR=1 EXPECT_OUTPUT=1 ;; @@ -30,7 +30,7 @@ while getopts ":wtfvh1-:" opt; do w) WAIT=1 ;; - h|v|1) + h|v) REDIRECT_STDERR=1 EXPECT_OUTPUT=1 ;; From 6a5bf633e95f56c5b2d1e6fa229bec780bc92994 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 3 Jun 2015 11:53:59 -0700 Subject: [PATCH 4/5] Show deprecation text via usage message --- src/browser/main.coffee | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/browser/main.coffee b/src/browser/main.coffee index 0ebb13950..75573291e 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -107,7 +107,7 @@ parseCommandLine = -> ATOM_HOME The root path for all configuration files and folders. Defaults to `~/.atom`. """ - options.boolean('include-deprecated-apis').describe('include-deprecated-apis', 'Include deprecated APIs') + options.boolean('include-deprecated-apis').describe('include-deprecated-apis', 'Include deprecated APIs.') 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.') @@ -121,16 +121,12 @@ parseCommandLine = -> 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.') options.string('socket-path') - options.alias('1', 'one').boolean('1') # Deprecated 1.0 API preview flag + + # Deprecated 1.0 API preview flag + options.alias('1', 'one').boolean('1').describe('1', 'The option is no longer supported. Atom now defaults to launching with the 1.0 API. Use --include-deprecated-apis to run Atom with deprecated APIs.') + args = options.argv - if args.one - process.stdout.write """ - The -1/--one option has been removed. Atom now defaults to launching with - the 1.0 API. Use --include-deprecated-apis to run Atom with deprecated APIs. - - """ - if args.help process.stdout.write(options.help()) process.exit(0) From 205059cd2f77ad97c60bf3deb37d7a0b05d1b6d8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 3 Jun 2015 12:00:48 -0700 Subject: [PATCH 5/5] The -> This --- src/browser/main.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/main.coffee b/src/browser/main.coffee index 75573291e..7e087eba4 100644 --- a/src/browser/main.coffee +++ b/src/browser/main.coffee @@ -123,7 +123,7 @@ parseCommandLine = -> options.string('socket-path') # Deprecated 1.0 API preview flag - options.alias('1', 'one').boolean('1').describe('1', 'The option is no longer supported. Atom now defaults to launching with the 1.0 API. Use --include-deprecated-apis to run Atom with deprecated APIs.') + options.alias('1', 'one').boolean('1').describe('1', 'This option is no longer supported. Atom now defaults to launching with the 1.0 API. Use --include-deprecated-apis to run Atom with deprecated APIs.') args = options.argv