From af284ee664ab3da7ce6324a46d4d9a59ef1e2362 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 17 Jun 2010 17:27:01 -0400 Subject: Added dynamic command line argument handling. --- modules/textadept/session.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/textadept/session.lua') diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua index 0ddfa2f9..d3b7a1e4 100644 --- a/modules/textadept/session.lua +++ b/modules/textadept/session.lua @@ -11,7 +11,7 @@ module('_m.textadept.session', package.seeall) -- -- * `DEFAULT_SESSION`: The path to the default session file. -- * `SAVE_ON_QUIT`: Save the session when quitting. Defaults to true and can be --- disabled by passing the command line switch '-ns' or '--no-session' to +-- disabled by passing the command line switch '-n' or '--no-session' to -- Textadept. -- settings @@ -95,6 +95,7 @@ function load(filename) end return true end +events.connect('arg_none', load) -- load session when no args are present --- -- Saves a Textadept session to a file. @@ -168,3 +169,7 @@ function save(filename) end events.connect('quit', function() if SAVE_ON_QUIT then save() end end, 1) + +local function no_session() SAVE_ON_QUIT = false end +args.register('-n', '--nosession', 0, no_session, 'No session functionality') + -- cgit v1.2.3