summaryrefslogtreecommitdiff
path: root/plugins/alias.py
diff options
context:
space:
mode:
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):