mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 20:22:36 +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",
|
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:
|
||||||
|
Loading…
Reference in New Issue
Block a user