From 599106e447bbcac4fda816b547ebc42b63132f1b Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 2 Oct 2010 21:44:03 -0500 Subject: [PATCH] require config file on the command line --- dr.botzo.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dr.botzo.py b/dr.botzo.py index 1c498da..77fec59 100644 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -76,10 +76,15 @@ class DrBotIRC(irclib.IRC): self.connections.append(c) return c +# check argv +if len(sys.argv) != 2: + sys.exit("Needs one argument, the config filename") + # read config file config = ConfigParser({'debug': 'false'}) -config.read([os.path.expanduser('~/.dr.botzo.cfg'), 'dr.botzo.cfg']) +#config.read([os.path.expanduser('~/.dr.botzo.cfg'), 'dr.botzo.cfg']) +config.read(os.path.expanduser(sys.argv[1])) # load necessary options try: