require config file on the command line

This commit is contained in:
Brian S. Stephan 2010-10-02 21:44:03 -05:00
parent 466eb6eff1
commit 599106e447
1 changed files with 6 additions and 1 deletions

View File

@ -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: