diff options
author | Florent Le Coz <louiz@louiz.org> | 2012-05-20 13:43:53 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-05-20 13:43:53 +0200 |
commit | 65c2d3dc8891eae4307375eef4b79d13ac793e46 (patch) | |
tree | 98359af6c6d9809585b52dcc1aadf083fa590412 /plugins/alias.py | |
parent | 0f0efb7ada6ad60f88360bc6a8feb3607fcabd3c (diff) | |
parent | 51c788ad96703d215942499ffefe6fdc98326b6b (diff) | |
download | poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.gz poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.bz2 poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.xz poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.zip |
Merge branch 'master' of https://git.louiz.org/poezio
Diffstat (limited to 'plugins/alias.py')
-rw-r--r-- | plugins/alias.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/alias.py b/plugins/alias.py index d6a46b6f..5a35d1c6 100644 --- a/plugins/alias.py +++ b/plugins/alias.py @@ -1,3 +1,9 @@ +""" +Alias plugin. + +Allows the creation and the removal of personal aliases. +""" + from plugin import BasePlugin import common from common import parse_command_args_to_alias as parse @@ -9,14 +15,16 @@ class Plugin(BasePlugin): self.commands = {} def command_alias(self, line): + """ + /alias <alias> <command> [args] + """ arg = common.shell_split(line) if len(arg) < 2: self.core.information('Alias: Not enough parameters', 'Error') return alias = arg[0] - tmp_args = common.shell_split(arg[1]) - command = tmp_args.pop(0) - tmp_args = arg[1][len(command)+1:] + command = arg[1] + tmp_args = arg[2] if len(arg) > 2 else '' if alias in self.core.commands or alias in self.commands: self.core.information('Alias: command already exists', 'Error') @@ -26,6 +34,9 @@ class Plugin(BasePlugin): self.core.information('Alias /%s successfuly created' % alias, 'Info') def command_unalias(self, alias): + """ + /unalias <existing alias> + """ if alias in self.commands: del self.commands[alias] self.del_command(alias) |