diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-12-10 18:53:51 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-12-10 18:54:12 +0100 |
commit | 96670133041dc6c0f6dd3453b4e6e2ab38b92cdf (patch) | |
tree | 0a08f32694055138ad5634f95b3494e6d3093b40 | |
parent | 067ad58f082417f49c3de626d2ec1f82d90ede28 (diff) | |
download | poezio-96670133041dc6c0f6dd3453b4e6e2ab38b92cdf.tar.gz poezio-96670133041dc6c0f6dd3453b4e6e2ab38b92cdf.tar.bz2 poezio-96670133041dc6c0f6dd3453b4e6e2ab38b92cdf.tar.xz poezio-96670133041dc6c0f6dd3453b4e6e2ab38b92cdf.zip |
Fix command_name’s arguments
-rw-r--r-- | src/tabs/rostertab.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tabs/rostertab.py b/src/tabs/rostertab.py index 3fbeefb0..52a3a88c 100644 --- a/src/tabs/rostertab.py +++ b/src/tabs/rostertab.py @@ -77,7 +77,7 @@ class RosterInfoTab(Tab): desc=_('Add the specified JID to your roster, ask him to allow you to see his presence, and allow him to see your presence.'), shortdesc=_('Add an user to your roster.')) self.register_command('name', self.command_name, - usage=_('<jid> <name>'), + usage=_('<jid> [name]'), shortdesc=_('Set the given JID\'s name.'), completion=self.completion_name) self.register_command('groupadd', self.command_groupadd, @@ -407,7 +407,7 @@ class RosterInfoTab(Tab): roster.modified() self.core.information('%s was added to the roster' % jid, 'Roster') - @command_args_parser.quoted(2) + @command_args_parser.quoted(1, 1) def command_name(self, args): """ Set a name for the specified JID in your roster @@ -416,7 +416,7 @@ class RosterInfoTab(Tab): if not iq: self.core.information('The name could not be set.', 'Error') log.debug('Error in /name:\n%s', iq) - if not args: + if args is None: return self.core.command_help('name') jid = safeJID(args[0]).bare name = args[1] if len(args) == 2 else '' |