]> jfr.im git - erebus.git/blobdiff - modules/test_flags.py
add flags parsing to modlib
[erebus.git] / modules / test_flags.py
diff --git a/modules/test_flags.py b/modules/test_flags.py
new file mode 100644 (file)
index 0000000..d3268c7
--- /dev/null
@@ -0,0 +1,31 @@
+# Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
+# Various highly recommended "control" commands.
+# This file is released into the public domain; see http://unlicense.org/
+
+# module info
+modinfo = {
+       'author': 'Erebus Team',
+       'license': 'public domain',
+       'compatible': [0],
+       'depends': [],
+       'softdeps': ['help'],
+}
+
+# preamble
+import modlib
+lib = modlib.modlib(__name__)
+modstart = lib.modstart
+modstop = lib.modstop
+
+# module code
+import sys, os
+import ctlmod
+from collections import deque
+
+
+@lib.hook(needchan=False)
+@lib.flags('foo','bar','baz','barz')
+@lib.argsGE(1)
+def flags(bot, user, chan, realtarget, flags, *args):
+       return repr((flags, args))