-@lib.argsGE(1)
-def modunload(bot, user, chan, realtarget, *args):
- module = None
- autoload = False
- force = False
- for arg in args:
- if arg[0] != "-":
- if module is not None:
- bot.msg(user, "Wrong number of arguments.")
- return
- module = arg
- elif arg == "-autoload":
- autoload = True
- elif arg == "-force":
- force = True
- else:
- bot.msg(user, "Bad option %s" % (arg))
+@lib.flags('force','autoload')
+@lib.argsEQ(1)
+def modunload(bot, user, chan, realtarget, flags, *args):
+ autoload = flags['autoload']
+ force = flags['force']
+ module = args[0]