Add an --override-restore argument.

See #523.
This commit is contained in:
Florian Bruhin 2015-03-24 07:50:23 +01:00
parent db98b03f34
commit 5043f58f3c
3 changed files with 8 additions and 1 deletions

View File

@ -46,6 +46,9 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl.
*-r* 'SESSION', *--restore* 'SESSION'::
Restore a named session.
*-R*, *--override-restore*::
Don't restore a session even if one would be restored.
=== debug arguments
*-l* 'LOGLEVEL', *--loglevel* 'LOGLEVEL'::
Set loglevel

View File

@ -261,6 +261,7 @@ class Application(QApplication):
message.error('current', "set: {} - {}".format(
e.__class__.__name__, e))
if not self._args.override_restore:
self._load_session(self._args.session)
session_manager = objreg.get('session-manager')
if not session_manager.did_load:

View File

@ -55,6 +55,9 @@ def get_argparser():
metavar=('SECTION', 'OPTION', 'VALUE'))
parser.add_argument('-r', '--restore', help="Restore a named session.",
dest='session')
parser.add_argument('-R', '--override-restore', help="Don't restore a "
"session even if one would be restored.",
action='store_true')
debug = parser.add_argument_group('debug arguments')
debug.add_argument('-l', '--loglevel', dest='loglevel',