Fix error in nick deletion parsing

This commit is contained in:
Griatch 2018-01-09 18:51:07 +01:00
parent 0ecf99ab4b
commit 05c6813dd9

View file

@ -89,7 +89,7 @@ class CmdNick(COMMAND_DEFAULT_CLASS):
inputline - replace on the inputline (default) inputline - replace on the inputline (default)
object - replace on object-lookup object - replace on object-lookup
account - replace on account-lookup account - replace on account-lookup
delete - remove nick by name or by index given by /list delete - remove nick by name or by index in /list
clearall - clear all nicks clearall - clear all nicks
list - show all defined aliases (also "nicks" works) list - show all defined aliases (also "nicks" works)
@ -125,7 +125,7 @@ class CmdNick(COMMAND_DEFAULT_CLASS):
Support escaping of = with \= Support escaping of = with \=
""" """
super(CmdNick, self).parse() super(CmdNick, self).parse()
args = (self.lhs or "") + " = %s" % self.rhs if self.rhs else "" args = (self.lhs or "") + (" = %s" % self.rhs if self.rhs else "")
parts = re.split(r"(?<!\\)=", args, 1) parts = re.split(r"(?<!\\)=", args, 1)
self.rhs = None self.rhs = None
if len(parts) < 2: if len(parts) < 2:
@ -166,6 +166,9 @@ class CmdNick(COMMAND_DEFAULT_CLASS):
return return
if not self.args or not self.lhs: if not self.args or not self.lhs:
if "delete" in switches or "del" in switches:
caller.msg("usage nick/delete nickname or #1 (use nicks for list)")
else:
caller.msg("Usage: nick[/switches] nickname = [realname]") caller.msg("Usage: nick[/switches] nickname = [realname]")
return return