mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Replace - with _ in command names
We might as well be nice if user accidentally types --training.use-gpu
This commit is contained in:
parent
bfa8e11ffa
commit
fb6f6f584e
|
@ -53,7 +53,7 @@ def parse_config_overrides(args: List[str]) -> Dict[str, Any]:
|
|||
opt = args.pop(0)
|
||||
err = f"Invalid config override '{opt}'"
|
||||
if opt.startswith("--"): # new argument
|
||||
opt = opt.replace("--", "")
|
||||
opt = opt.replace("--", "").replace("-", "_")
|
||||
if "." not in opt:
|
||||
msg.fail(f"{err}: can't override top-level section", exits=1)
|
||||
if not args or args[0].startswith("--"): # flag with no value
|
||||
|
|
Loading…
Reference in New Issue
Block a user