From 7baa81aa30f7065fc03216475b1690e29d9cd000 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 1 Sep 2018 00:48:15 +0100 Subject: [PATCH] Fix bug with the inside parameter being specified by default --- commands/mon.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/commands/mon.py b/commands/mon.py index 5231abe..bfcf5bf 100644 --- a/commands/mon.py +++ b/commands/mon.py @@ -20,8 +20,7 @@ class Mon: group2.add_argument("-p", "--append", action="store_true", dest="doAppend", help="Append entries to lists instead of replacing") group2.add_argument("-r", "--remove", action="store_true", dest="doRemove", help="Remove entries in lists instead of replacing") - self.parser.add_argument("--inside", action="store_true", dest="inside", help="Use x in y logic for matching instead of comparing exact values") - self.parser.add_argument("--outside", action="store_false", dest="inside", help="Don't use x in y logic for matching instead of comparing exact values") + self.parser.add_argument("--inside", dest="inside", help="Use x in y logic for matching instead of comparing exact values") self.parser.add_argument("--type", nargs="*", metavar="type", dest="specType", help="Specify type of spec matching. Available types: join, part, quit, msg, topic, mode, nick, kick, notice, action, who") self.parser.add_argument("--free", nargs="*", metavar="query", dest="free", help="Use freeform matching") @@ -222,7 +221,13 @@ class Mon: for i in obj.real: cast["real"].append(" ".join(i)) if not obj.inside == None: - cast["inside"] = obj.inside + if obj.inside.lower() in ["yes", "true", "on"]: + cast["inside"] = True + elif obj.inside.lower() in ["no", "false", "off"]: + cast["inside"] = False + else: + failure("inside: Unknown operand: %s" % obj.inside) + return return cast def subtractCast(self, source, patch, info):