Fix bug with the inside parameter being specified by default

This commit is contained in:
Mark Veidemanis 2018-09-01 00:48:15 +01:00
parent 249e99805a
commit 7baa81aa30
1 changed files with 8 additions and 3 deletions

View File

@ -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):