[options] add '--config-json' command-line option
This commit is contained in:
@@ -33,8 +33,10 @@ def main():
|
||||
config.log.error(exc)
|
||||
if args.config_load:
|
||||
config.load()
|
||||
if args.configs_extra:
|
||||
config.load(args.configs_extra, strict=True)
|
||||
if args.configs_json:
|
||||
config.load(args.configs_json, strict=True)
|
||||
config.load(args.configs_json, strict=True, loads=util.json_loads)
|
||||
if args.configs_yaml:
|
||||
import yaml
|
||||
config.load(args.configs_yaml, strict=True, loads=yaml.safe_load)
|
||||
|
||||
@@ -616,6 +616,11 @@ def build_parser():
|
||||
)
|
||||
configuration.add_argument(
|
||||
"-c", "--config",
|
||||
dest="configs_extra", metavar="FILE", action="append",
|
||||
help="Additional configuration files in default format",
|
||||
)
|
||||
configuration.add_argument(
|
||||
"--config-json",
|
||||
dest="configs_json", metavar="FILE", action="append",
|
||||
help="Additional configuration files in JSON format",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user