From c25d790b47488e8320fc511377d2fe52393b06c9 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 29 Jan 2016 18:44:39 -0500 Subject: Code cleanup; core/args.lua --- core/args.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'core/args.lua') diff --git a/core/args.lua b/core/args.lua index caddee0c..9b90d4ab 100644 --- a/core/args.lua +++ b/core/args.lua @@ -65,15 +65,15 @@ end events.connect(events.INITIALIZED, function() if arg then process(arg) end end) events.connect('cmd_line', process) -- undocumented, single-instance event --- Shows all registered command line switches on the command line. -local function show_help() - print('Usage: textadept [args] [filenames]') - local line = " %s [%d args]: %s" - for k, v in pairs(switches) do print(line:format(k, table.unpack(v, 2))) end - os.exit() -end if not CURSES then - M.register('-h', '--help', 0, show_help, 'Shows this') + -- Shows all registered command line switches on the command line. + M.register('-h', '--help', 0, function() + print('Usage: textadept [args] [filenames]') + local line = " %s [%d args]: %s" + for k, v in pairs(switches) do print(line:format(k, table.unpack(v, 2))) end + os.exit() + end, 'Shows this') + -- Shows Textadept version and copyright on the command line. M.register('-v', '--version', 0, function() print(_RELEASE..'\n'.._COPYRIGHT) quit() -- cgit v1.2.3