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

cmd line switch to set options

This commit is contained in:
Mike Fährmann 2015-11-10 01:56:31 +01:00
parent 3510faaed5
commit 3eaae19345
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -32,6 +32,11 @@ def parse_cmdline_options():
metavar="DEST", metavar="DEST",
help="destination directory" help="destination directory"
) )
parser.add_argument(
"-o", "--option",
metavar="OPT", action="append",
help="option value",
)
parser.add_argument( parser.add_argument(
"urls", "urls",
nargs="+", metavar="URL", nargs="+", metavar="URL",
@ -40,8 +45,11 @@ def parse_cmdline_options():
return parser.parse_args() return parser.parse_args()
def main(): def main():
args = parse_cmdline_options()
config.load() config.load()
opts = parse_cmdline_options() for opt in args.option:
key, value = opt.split("=", 1)
config.set(key.split("."), value)
dlmgr = download.DownloadManager(opts) dlmgr = download.DownloadManager(opts)
try: try: