diff options
author | mathieui <mathieui@mathieui.net> | 2012-07-29 19:45:46 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-07-29 19:45:46 +0200 |
commit | ec7dd75012bafd5281e88aa83c54547cb3b36bf5 (patch) | |
tree | 249d1ba846af995bbbc7078ba97dbfa8a0352c16 /src/core.py | |
parent | e7837355d1f0758a86e097b9728374e7cbfcf5bf (diff) | |
download | poezio-ec7dd75012bafd5281e88aa83c54547cb3b36bf5.tar.gz poezio-ec7dd75012bafd5281e88aa83c54547cb3b36bf5.tar.bz2 poezio-ec7dd75012bafd5281e88aa83c54547cb3b36bf5.tar.xz poezio-ec7dd75012bafd5281e88aa83c54547cb3b36bf5.zip |
/bind with only one argument now resets the binding
Diffstat (limited to 'src/core.py')
-rw-r--r-- | src/core.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core.py b/src/core.py index b783f538..e7897c59 100644 --- a/src/core.py +++ b/src/core.py @@ -1945,10 +1945,15 @@ class Core(object): Bind a key. """ args = common.shell_split(arg) - if len(args) != 2: + if len(args) < 1: return self.command_help('bind') + elif len(args) < 2: + args.append("") config.set_and_save(args[0], args[1], section='bindings') - self.information('%s is now bound to %s' % (args[0], args[1]), 'Info') + if args[1]: + self.information('%s is now bound to %s' % (args[0], args[1]), 'Info') + else: + self.information('%s is now unbound' % args[0], 'Info') def command_pubsub(self, args): """ |