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