1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

implement --list-keywords cmd-line option

This commit is contained in:
Mike Fährmann 2015-11-13 01:19:01 +01:00
parent edf3f7b69f
commit 90247977c9
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -37,6 +37,10 @@ def parse_cmdline_options():
metavar="OPT", action="append", default=[],
help="option value",
)
parser.add_argument(
"--list-keywords", dest="keywords", action="store_true",
help="print a list of available keywords",
)
parser.add_argument(
"urls",
nargs="+", metavar="URL",
@ -53,8 +57,9 @@ def main():
config.set(key.split("."), value)
except TypeError:
pass
jobtype = jobs.KeywordJob if args.keywords else jobs.DownloadJob
try:
for url in args.urls:
jobs.DownloadJob(url).run()
jobtype(url).run()
except KeyboardInterrupt:
print("\nKeyboardInterrupt")