Display full help text on bare "!fwarn" and "!fwarn help"
It was listing the warnings on a bare "!fwarn" because re.split() returned an array containing one element, the empty string. And it's not really helpful to show just the syntax for the help subcommand in "!fwarn help", because it already does that in the normal help message, and also shows the available subcommands.
This commit is contained in:
parent
5b0dae3cb3
commit
313d33f1a2
@ -480,7 +480,7 @@ def fwarn(cli, nick, chan, rest):
|
||||
# If specified, must be prefixed with |. This means | is not a valid character for use
|
||||
# in reasons (no escaping is performed).
|
||||
|
||||
params = re.split(" +", rest)
|
||||
params = rest.split()
|
||||
target = None
|
||||
points = None
|
||||
expires = None
|
||||
@ -520,7 +520,7 @@ def fwarn(cli, nick, chan, rest):
|
||||
try:
|
||||
subcommand = params.pop(0)
|
||||
except IndexError:
|
||||
reply(cli, nick, chan, messages["fwarn_help_syntax"])
|
||||
reply(cli, nick, chan, messages["fwarn_usage"])
|
||||
return
|
||||
if subcommand not in ("list", "view", "add", "del", "set", "help"):
|
||||
reply(cli, nick, chan, messages["fwarn_usage"])
|
||||
|
Loading…
Reference in New Issue
Block a user