From fe532b9dd52236a126be053ebfdc66dbd59fd815 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 28 May 2013 17:52:19 -0700 Subject: [PATCH] Add initial help message --- src/main.coffee | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.coffee b/src/main.coffee index 2e20853b1..1fca3f276 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -16,7 +16,18 @@ getHomeDir = -> process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME'] parseCommandLine = -> - args = optimist(process.argv[1..]).argv + options = optimist(process.argv[1..]) + options.usage """ + + Usage: atom [options] [file ..] + + """ + options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.') + args = options.argv + if args.h + options.showHelp() + process.exit(0) + executedFrom = args['executed-from'] pathsToOpen = if args._.length > 0 then args._ else null testMode = true if args['test']