add flag to show configuration and db info

This commit is contained in:
TheDen 2023-04-27 21:24:33 +10:00
parent fb5944a5ed
commit 0749553d00
No known key found for this signature in database
GPG Key ID: 422C77464A8E7F4A
2 changed files with 12 additions and 0 deletions

View File

@ -150,6 +150,12 @@ def main():
if arguments.reset: if arguments.reset:
sys.exit(_reset_config(CONFIG_FILE)) sys.exit(_reset_config(CONFIG_FILE))
if arguments.show_config:
print(f"Configuation: {CONFIG_FILE}\nDatabase: {QOBUZ_DB}\n---")
with open(CONFIG_FILE, "r") as f:
print(f.read())
sys.exit()
if arguments.purge: if arguments.purge:
try: try:
os.remove(QOBUZ_DB) os.remove(QOBUZ_DB)

View File

@ -149,6 +149,12 @@ def qobuz_dl_args(
action="store_true", action="store_true",
help="purge/delete downloaded-IDs database", help="purge/delete downloaded-IDs database",
) )
parser.add_argument(
"-c",
"--show-config",
action="store_true",
help="show configuration",
)
subparsers = parser.add_subparsers( subparsers = parser.add_subparsers(
title="commands", title="commands",