From b04a233e8d8893883a8e531eee793c52599b7252 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 12 Sep 2017 15:11:16 +0200 Subject: [PATCH] Adjust :unbind signature to match :bind --- doc/help/commands.asciidoc | 6 ++++-- qutebrowser/config/config.py | 2 +- tests/unit/config/test_config.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 9d5fd6aeb..25c4c463f 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -933,13 +933,15 @@ How many tabs to switch back. [[unbind]] === unbind -Syntax: +:unbind 'key' ['mode']+ +Syntax: +:unbind [*--mode* 'mode'] 'key'+ Unbind a keychain. ==== positional arguments * +'key'+: The keychain or special key (inside <...>) to unbind. -* +'mode'+: A mode to unbind the key in (default: `normal`). See `:help bindings.commands` for the available modes. + +==== optional arguments +* +*-m*+, +*--mode*+: A mode to unbind the key in (default: `normal`). See `:help bindings.commands` for the available modes. [[undo]] diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 5d211a7b4..6c92bedc1 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -347,7 +347,7 @@ class ConfigCommands: raise cmdexc.CommandError("bind: {}".format(e)) @cmdutils.register(instance='config-commands') - def unbind(self, key, mode='normal'): + def unbind(self, key, *, mode='normal'): """Unbind a keychain. Args: diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index d5bca4454..572a6c6f8 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -572,7 +572,7 @@ class TestBindConfigCommand: Should show an error. """ with pytest.raises(cmdexc.CommandError, match=expected): - commands.unbind(key, mode) + commands.unbind(key, mode=mode) class TestConfig: