From 0847643b548d1f5014c1af56a86c0e6c2d7ce92f Mon Sep 17 00:00:00 2001
From: mathieui <mathieui@mathieui.net>
Date: Fri, 11 Apr 2014 00:55:42 +0200
Subject: Fix #2421 (load and unload several plugins)

---
 src/core/commands.py | 18 ++++++------------
 src/core/core.py     | 10 +++++-----
 2 files changed, 11 insertions(+), 17 deletions(-)

(limited to 'src/core')

diff --git a/src/core/commands.py b/src/core/commands.py
index 68a6eacf..f2a6d2f4 100644
--- a/src/core/commands.py
+++ b/src/core/commands.py
@@ -797,25 +797,19 @@ def command_rawxml(self, arg):
 
 def command_load(self, arg):
     """
-    /load <plugin>
+    /load <plugin> [<otherplugin> …]
     """
     args = arg.split()
-    if len(args) != 1:
-        self.command_help('load')
-        return
-    filename = args[0]
-    self.plugin_manager.load(filename)
+    for plugin in args:
+        self.plugin_manager.load(plugin)
 
 def command_unload(self, arg):
     """
-    /unload <plugin>
+    /unload <plugin> [<otherplugin> …]
     """
     args = arg.split()
-    if len(args) != 1:
-        self.command_help('unload')
-        return
-    filename = args[0]
-    self.plugin_manager.unload(filename)
+    for plugin in args:
+        self.plugin_manager.unload(plugin)
 
 def command_plugins(self, arg=''):
     """
diff --git a/src/core/core.py b/src/core/core.py
index c3090bf6..39eb31b7 100644
--- a/src/core/core.py
+++ b/src/core/core.py
@@ -1542,19 +1542,19 @@ class Core(object):
                 shortdesc=_('Cycle a range of rooms'),
                 completion=self.completion_server_cycle)
         self.register_command('bind', self.command_bind,
-                usage=_(' <key> <equ>'),
+                usage=_('<key> <equ>'),
                 desc=_("Bind a key to another key or to a “command”. For "
                     "example \"/bind ^H KEY_UP\" makes Control + h do the"
                     " same same as the Up key."),
                 completion=self.completion_bind,
                 shortdesc=_('Bind a key to another key.'))
         self.register_command('load', self.command_load,
-                usage=_('<plugin>'),
-                shortdesc=_('Load the specified plugin'),
+                usage=_('<plugin> [<otherplugin> …]'),
+                shortdesc=_('Load the specified plugin(s)'),
                 completion=self.plugin_manager.completion_load)
         self.register_command('unload', self.command_unload,
-                usage=_('<plugin>'),
-                shortdesc=_('Unload the specified plugin'),
+                usage=_('<plugin> [<otherplugin> …]'),
+                shortdesc=_('Unload the specified plugin(s)'),
                 completion=self.plugin_manager.completion_unload)
         self.register_command('plugins', self.command_plugins,
                 shortdesc=_('Show the plugins in use.'))
-- 
cgit v1.2.3