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=[],
|
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")
|
||||||
|
Loading…
Reference in New Issue
Block a user