From 4675e05cae98e539f0d8e19be3b58c74ec4858ec Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 12 Jul 2020 13:48:32 +0200 Subject: Avoid :help being called with deprecated commands (cherry picked from commit 5dc0e6528b21588750fadae4376a34db68d62f7f) --- qutebrowser/browser/commands.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 1707c398d..e2cef8003 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1353,6 +1353,12 @@ class CommandDispatcher: if command not in objects.commands: raise cmdutils.CommandError("Invalid command {}!".format( command)) + + deprecated = objects.commands[command].deprecated + if deprecated: + raise cmdutils.CommandError( + "{} is deprecated - {}".format(command, deprecated)) + path = 'commands.html#{}'.format(command) elif topic in configdata.DATA: path = 'settings.html#{}'.format(topic) -- cgit v1.2.3-54-g00ecf