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:
parent
3510faaed5
commit
3eaae19345
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user