]> jfr.im git - erebus.git/commitdiff
control - use new flag-style options in error messages
authorJohn Runyon <redacted>
Wed, 4 Oct 2023 07:22:09 +0000 (01:22 -0600)
committerJohn Runyon <redacted>
Wed, 4 Oct 2023 07:22:09 +0000 (01:22 -0600)
modules/control.py

index 2e3dafb5ad8af206fd71002a9250912c6ec1dd27..58f2d94b5e6a747f17555b72bc9c0b2ea2df5ef9 100644 (file)
@@ -68,12 +68,12 @@ def modunload(bot, user, chan, realtarget, *args):
        for arg in args:
                if arg[0] != "-":
                        if module is not None:
-                               bot.msg(user, "Wrong number of arguments.")
+                               bot.msg(user, "Incorrect syntax - can only name one module")
                                return
                        module = arg
-               elif arg == "-autoload":
+               elif arg.lower() == "-autoload":
                        autoload = True
-               elif arg == "-force":
+               elif arg.lower() == "-force":
                        force = True
                else:
                        bot.msg(user, "Bad option %s" % (arg))
@@ -86,7 +86,7 @@ def modunload(bot, user, chan, realtarget, *args):
                return
        if len(ctlmod.dependents[module]) > 0:
                if not force:
-                       bot.msg(user, "That module has dependents! Say MODUNLOAD %s FORCE to unload it and any dependents." % (module))
+                       bot.msg(user, "That module has dependents! Say MODUNLOAD -force %s to unload it and any dependents." % (module))
                        return
 
        okay = ctlmod.unload(bot.parent, module)