# HG changeset patch # User Mikael Berthe # Date 1214069517 -7200 # Node ID 1400a0fa01d4a7b4ffd66da70a68731783a97b3a # Parent da4bef36c34fedb1ca23f4d2c9a1dc83579ea915 Add command line option -c diff -r da4bef36c34f -r 1400a0fa01d4 mcevent.py --- a/mcevent.py Sat Jun 21 19:14:30 2008 +0200 +++ b/mcevent.py Sat Jun 21 19:31:57 2008 +0200 @@ -8,7 +8,7 @@ # see the file COPYING in the root mcabber source directory. # -import sys +import sys, getopt import pynotify CONFFILE = "mcevent.cfg" @@ -202,6 +202,16 @@ ##### MAIN ##### +try: + opts, args = getopt.getopt(sys.argv[1:], "c:", ["help", "output="]) +except getopt.GetoptError, err: + print str(err) + sys.exit(2) + +for o, a in opts: + if o == "-c": + CONFFILE = a + NOTIFY_LOADED = False # read stdin line by line @@ -221,4 +231,6 @@ if NOTIFY_LOADED: pynotify.uninit() +sys.exit(0) + # vim:set et sts=4 sw=4: