From 5043f58f3c4714e28ca5a940208445cf2ceffa72 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 24 Mar 2015 07:50:23 +0100 Subject: [PATCH] Add an --override-restore argument. See #523. --- doc/qutebrowser.1.asciidoc | 3 +++ qutebrowser/app.py | 3 ++- qutebrowser/qutebrowser.py | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/qutebrowser.1.asciidoc b/doc/qutebrowser.1.asciidoc index f4f81f2d0..87d0329d7 100644 --- a/doc/qutebrowser.1.asciidoc +++ b/doc/qutebrowser.1.asciidoc @@ -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 diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 9b3e064eb..a3a0ffa24 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -261,7 +261,8 @@ class Application(QApplication): message.error('current', "set: {} - {}".format( e.__class__.__name__, e)) - self._load_session(self._args.session) + if not self._args.override_restore: + self._load_session(self._args.session) session_manager = objreg.get('session-manager') if not session_manager.did_load: log.init.debug("Initializing main window...") diff --git a/qutebrowser/qutebrowser.py b/qutebrowser/qutebrowser.py index fd0243534..eb5cb651c 100644 --- a/qutebrowser/qutebrowser.py +++ b/qutebrowser/qutebrowser.py @@ -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',