diff --git a/gallery_dl/__init__.py b/gallery_dl/__init__.py index 147e874a..114d56f6 100644 --- a/gallery_dl/__init__.py +++ b/gallery_dl/__init__.py @@ -32,6 +32,11 @@ def parse_cmdline_options(): metavar="DEST", help="destination directory" ) + parser.add_argument( + "-o", "--option", + metavar="OPT", action="append", + help="option value", + ) parser.add_argument( "urls", nargs="+", metavar="URL", @@ -40,8 +45,11 @@ def parse_cmdline_options(): return parser.parse_args() def main(): + args = parse_cmdline_options() 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) try: