From b487caf12dd3079265593318cd4b35f367fb0598 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 6 Jan 2011 22:43:10 -0600 Subject: [PATCH] make the config file argument optional. this should probably be robustified (--config-file=foo) eventually --- dr.botzo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dr.botzo.py b/dr.botzo.py index 3a461cd..66aa23e 100644 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -69,14 +69,15 @@ class DrBotIRC(irclib.IRC): self.connections.append(c) return c +config_file = 'dr.botzo.cfg' # check argv -if len(sys.argv) != 2: - sys.exit("Needs one argument, the config filename") +if len(sys.argv) == 2: + config_file = sys.argv[1] # read config file config = ConfigParser({'debug': 'false'}) -config.read(os.path.expanduser(sys.argv[1])) +config.read(os.path.expanduser(config_file)) # load necessary options try: