From 412aeff6dc59c77f3d686de10f261d2a1ed67803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 4 Feb 2020 14:00:19 +0100 Subject: load, unload: prevent Traceback when not enough parameters are specified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/core/commands.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/poezio/core/commands.py b/poezio/core/commands.py index 50bbca68..fca9a705 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -1115,11 +1115,17 @@ class CommandCore: exc_info=True) @command_args_parser.quoted(1, 256) - def load(self, args): + def load(self, args: List[str]) -> None: """ /load [ …] # TODO: being able to load more than 256 plugins at once, hihi. """ + + usage = '/load [ …]' + if not args: + self.core.information(usage, 'Error') + return + for plugin in args: self.core.plugin_manager.load(plugin) @@ -1128,6 +1134,12 @@ class CommandCore: """ /unload [ …] """ + + usage = '/unload [ …]' + if not args: + self.core.information(usage, 'Error') + return + for plugin in args: self.core.plugin_manager.unload(plugin) -- cgit v1.2.3