diff --git a/gallery_dl/__init__.py b/gallery_dl/__init__.py index 7633a8f6..acdad000 100644 --- a/gallery_dl/__init__.py +++ b/gallery_dl/__init__.py @@ -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")