From 313d33f1a22dd7738932af015781cee55bd14ea4 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Sat, 19 Nov 2016 17:10:50 +0100 Subject: [PATCH] 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. --- src/warnings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/warnings.py b/src/warnings.py index 3df7df6..e5ec3a7 100644 --- a/src/warnings.py +++ b/src/warnings.py @@ -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"])