diff options
author | 2015-01-22 15:11:06 -0500 | |
---|---|---|
committer | 2015-01-22 15:11:06 -0500 | |
commit | 3f75097ce48896a583fdce6df819135b98e1585f (patch) | |
tree | e73d1ae7f8ecd9eee183108dd042099d3b46350f /core | |
parent | 20aa582f292e2a7f4611b9c4d36e4b204832b009 (diff) | |
download | textadept-3f75097ce48896a583fdce6df819135b98e1585f.tar.gz textadept-3f75097ce48896a583fdce6df819135b98e1585f.zip |
Made `args.process()` private.
Diffstat (limited to 'core')
-rw-r--r-- | core/args.lua | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/args.lua b/core/args.lua index 1a96d2ec..8b478aa9 100644 --- a/core/args.lua +++ b/core/args.lua @@ -36,7 +36,6 @@ function M.register(short, long, narg, f, description) switches[short], switches[long] = t, t end ---- -- Processes command line argument table *arg*, handling switches previously -- defined using `args.register()` and treating unrecognized arguments as -- filenames to open. @@ -44,8 +43,7 @@ end -- @param arg Argument table. -- @see register -- @see _G.events --- @name process -function M.process(arg) +local function process(arg) local no_args = true local i = 1 while i <= #arg do @@ -64,6 +62,8 @@ function M.process(arg) end if no_args then events.emit(events.ARG_NONE) end 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() @@ -98,7 +98,4 @@ _G._USERHOME = userhome M.register('-u', '--userhome', 1, function() end, 'Sets alternate _USERHOME') M.register('-f', '--force', 0, function() end, 'Forces unique instance') -events.connect(events.INITIALIZED, - function() if arg then M.process(arg) end end) - return M |