chiark / gitweb /
new trouts from rejs
[irc.git] / acrobat.py
index 6bed11a18dcc70e92640353b39c77c269d748d4d..0d9202ea8f46b430cc2de8cfb0199b55ec58e4fd 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 #
 # Bot logic:
 # Andrew Walkingshaw <andrew@lexical.org.uk>
@@ -78,7 +78,7 @@ class Acrobat(SingleServerIRCBot):
            self.connection.notice(nick, msg)
 
 def main():
-    if len(sys.argv)!=2:
+    if len(sys.argv) < 2:
        print "acrobat: provide configuration module name on command line"
        sys.exit(1)
     try:
@@ -86,6 +86,10 @@ def main():
     except ImportError:
        print "acrobat: configuration module "+sys.argv[1]+".py not found"
        sys.exit(1)
+    # Override configuration items from the rest of the command line
+    for opt in sys.argv[2:]:
+        (key,value)=opt.split("=")
+        c.__dict__[key] = value
     bot = Acrobat(c)
     bot.start()