aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2016-03-31 13:20:56 +0100
committerGravatar jesopo2016-03-31 13:20:56 +0100
commit19083d3bf6dc56e51fd67123cff067dc1865df6b (patch)
treee8f7f5bc54e979a165e87d48ed44cb84d647c475
parentmade the args for IRCLineHandler functions global and added a timer-based cha... (diff)
added command line options to start.py for config file and database file locaitons.
-rwxr-xr-xstart.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/start.py b/start.py
index bb919dfe..eea23d2d 100755
--- a/start.py
+++ b/start.py
@@ -7,9 +7,17 @@ def bool_input(s):
result = input("%s (Y/n): " % s)
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()
-database = Database.Database(bot)
-config_object = Config.Config(bot)
+database = Database.Database(bot, args.database)
+config_object = Config.Config(bot, args.config)
bot.database = database
bot.config_object = config_object