From e1956533a6e04d7ba2afdbc841b48804a84120b3 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 1 Mar 2013 19:25:31 +0100 Subject: Fix #2231 (update the plugins to use the new help system) And fix some imprecisions/mistakes in the help. --- plugins/alias.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'plugins/alias.py') diff --git a/plugins/alias.py b/plugins/alias.py index 5a35d1c6..163e4c26 100644 --- a/plugins/alias.py +++ b/plugins/alias.py @@ -10,8 +10,15 @@ from common import parse_command_args_to_alias as parse class Plugin(BasePlugin): def init(self): - self.add_command('alias', self.command_alias, '/alias \nAlias: create an alias command') - self.add_command('unalias', self.command_unalias, '/unalias \nUnalias: remove a previously created alias') + self.add_command('alias', self.command_alias, + usage=' [args]', + short='Create an alias command', + help='Create an alias for with [args].') + self.add_command('unalias', self.command_unalias, + usage='', + help='Remove a previously created alias', + short='Remove an alias', + completion=self.completion_unalias) self.commands = {} def command_alias(self, line): @@ -42,6 +49,11 @@ class Plugin(BasePlugin): self.del_command(alias) self.core.information('Alias /%s successfuly deleted' % alias, 'Info') + def completion_unalias(self, the_input): + aliases = [alias for alias in self.commands] + aliases.sort() + return the_input.auto_completion(aliases, '', quotify=False) + def get_command(self, name): """Returns the function associated with a command""" def dummy(args): -- cgit v1.2.3