aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-06-17 17:27:01 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2010-06-17 17:27:01 -0400
commitaf284ee664ab3da7ce6324a46d4d9a59ef1e2362 (patch)
tree2b17a6fdc7ca19546937a433e6dbe00f7d60d855 /modules
parent8a7566b91ed01957f635d21362b039cb41a76280 (diff)
downloadtextadept-af284ee664ab3da7ce6324a46d4d9a59ef1e2362.tar.gz
textadept-af284ee664ab3da7ce6324a46d4d9a59ef1e2362.zip
Added dynamic command line argument handling.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/session.lua7
1 files changed, 6 insertions, 1 deletions
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')
+