cmd line switch to set options
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user