allow overriding kcpps values with explicit args

This commit is contained in:
Concedo 2024-09-21 11:00:10 +08:00
parent 55a249d222
commit 4b6a12e9c0

View file

@ -3746,7 +3746,12 @@ def load_config_cli(filename):
with open(filename, 'r') as f: with open(filename, 'r') as f:
config = json.load(f) config = json.load(f)
args.istemplate = False args.istemplate = False
raw_args = (sys.argv[1:]) #a lousy hack to allow for overriding kcpps
for key, value in config.items(): for key, value in config.items():
if f"--{key}" in raw_args:
if key!="config":
print(f"Overriding Config Value: {key}")
else:
setattr(args, key, value) setattr(args, key, value)
if args.istemplate: if args.istemplate:
print("\nA .kcppt template was selected from CLI - automatically selecting your backend...") print("\nA .kcppt template was selected from CLI - automatically selecting your backend...")