added command line options to start.py for config file and database file locaitons.
This commit is contained in:
parent
acc38b7460
commit
19083d3bf6
1 changed files with 10 additions and 2 deletions
12
start.py
12
start.py
|
@ -7,9 +7,17 @@ def bool_input(s):
|
||||||
result = input("%s (Y/n): " % s)
|
result = input("%s (Y/n): " % s)
|
||||||
return not result or result[0].lower() in ["", "y"]
|
return not result or result[0].lower() in ["", "y"]
|
||||||
|
|
||||||
|
arg_parser = argparse.ArgumentParser(
|
||||||
|
description="Python3 event-driven asynchronous modular IRC bot")
|
||||||
|
arg_parser.add_argument("--config", "-c", default="bot.json",
|
||||||
|
help="Location of the JSON config file")
|
||||||
|
arg_parser.add_argument("--database", "-d", default="bot.db",
|
||||||
|
help="Location of the sqlite3 database file")
|
||||||
|
args = arg_parser.parse_args()
|
||||||
|
|
||||||
bot = IRCBot.Bot()
|
bot = IRCBot.Bot()
|
||||||
database = Database.Database(bot)
|
database = Database.Database(bot, args.database)
|
||||||
config_object = Config.Config(bot)
|
config_object = Config.Config(bot, args.config)
|
||||||
bot.database = database
|
bot.database = database
|
||||||
bot.config_object = config_object
|
bot.config_object = config_object
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue