Added selecting a database

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2021-03-03 22:38:27 +00:00
parent d163f44484
commit 3fd2c90929

View file

@ -26,6 +26,7 @@ from common import norm
verbose = False
dbuser = ""
dbpw = ""
dbname = "worldbuild"
fname = ""
repeat = 0
@ -47,6 +48,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] == "-r" or sys.argv[i] == "--repeat":
i += 1
repeat = int(sys.argv[i])
@ -60,6 +64,7 @@ while i < argc:
print(" -f, --file Output file")
print(" -u, --user Database user")
print(" -p, --password Database password")
print(" -d, --database Database to be used. Default: worldbuild")
print(" -v, --verbose Verbose printouts")
print(" -r, --repeat If set, run every <n> minutes else run once")
print(" -h, --help Shows this help and exit")