From fb6f6f584e574fb21df717f302b2ec9e1d83d6d0 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Fri, 10 Jul 2020 22:34:22 +0200 Subject: [PATCH] Replace - with _ in command names We might as well be nice if user accidentally types --training.use-gpu --- spacy/cli/_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/cli/_util.py b/spacy/cli/_util.py index b328025ed..b72ee83ec 100644 --- a/spacy/cli/_util.py +++ b/spacy/cli/_util.py @@ -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