summaryrefslogtreecommitdiff
path: root/plugins/alias.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-03-01 19:25:31 +0100
committermathieui <mathieui@mathieui.net>2013-03-01 19:25:31 +0100
commite1956533a6e04d7ba2afdbc841b48804a84120b3 (patch)
treefc2e61bacc68adc9d0c5382a4797018db1223eab /plugins/alias.py
parent43c93a0a1b84c87b587174c49753b036f42672cd (diff)
downloadpoezio-e1956533a6e04d7ba2afdbc841b48804a84120b3.tar.gz
poezio-e1956533a6e04d7ba2afdbc841b48804a84120b3.tar.bz2
poezio-e1956533a6e04d7ba2afdbc841b48804a84120b3.tar.xz
poezio-e1956533a6e04d7ba2afdbc841b48804a84120b3.zip
Fix #2231 (update the plugins to use the new help system)
And fix some imprecisions/mistakes in the help.
Diffstat (limited to 'plugins/alias.py')
-rw-r--r--plugins/alias.py16
1 files changed, 14 insertions, 2 deletions
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 <alias> <command> <args>\nAlias: create an alias command')
- self.add_command('unalias', self.command_unalias, '/unalias <alias>\nUnalias: remove a previously created alias')
+ self.add_command('alias', self.command_alias,
+ usage='<alias> <command> [args]',
+ short='Create an alias command',
+ help='Create an alias for <command> with [args].')
+ self.add_command('unalias', self.command_unalias,
+ usage='<alias>',
+ 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):