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:
parent
edf3f7b69f
commit
90247977c9
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user