diff options
author | 2016-01-29 18:44:39 -0500 | |
---|---|---|
committer | 2016-01-29 18:44:39 -0500 | |
commit | c25d790b47488e8320fc511377d2fe52393b06c9 (patch) | |
tree | ec7fd0b622c5a484c1de5017f9a50bc058ad5242 | |
parent | e6fe3a375cd464b2cd9709e073f9cfa4ceb2a313 (diff) | |
download | textadept-c25d790b47488e8320fc511377d2fe52393b06c9.tar.gz textadept-c25d790b47488e8320fc511377d2fe52393b06c9.zip |
Code cleanup; core/args.lua
-rw-r--r-- | core/args.lua | 16 |
1 files changed, 8 insertions, 8 deletions
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() |