diff --git a/worldbuild-manager.py b/worldbuild-manager.py index b1f3358..6a66dee 100755 --- a/worldbuild-manager.py +++ b/worldbuild-manager.py @@ -28,6 +28,7 @@ port = 12345 verbose = False dbuser = "" dbpw = "" +dbname = "worldbuild" argc = len(sys.argv) i = 1 @@ -44,6 +45,9 @@ while i < argc: elif sys.argv[i] == "-p" or sys.argv[i] == "--password": i += 1 dbpw = sys.argv[i] + elif sys.argv[i] == "-d" or sys.argv[i] == "--database": + i += 1 + dbname = sys.argv[i] elif sys.argv[i] == "-v": verbose = True elif sys.argv[i] == "-h" or sys.argv[i] == "--help": @@ -51,6 +55,7 @@ while i < argc: print("Handles job asignments and keeps track of the status") print("") print("OPTIONS") + print(" -d, --database Database name") print(" -u, --user Database user") print(" -p, --password Database password") print(" -v, --verbose Verbose printouts") @@ -71,7 +76,7 @@ if dbpw == "": print("ERROR: No database password given") sys.exit(1) -db = pymysql.connect("localhost", dbuser, dbpw, "worldbuild") +db = pymysql.connect("localhost", dbuser, dbpw, dbname) cursor = db.cursor()