From 3583ea84d8fb6979d068c23816c0994dab5f81a4 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Fri, 10 Jul 2020 18:20:52 +0200 Subject: [PATCH] Update arg parsing --- spacy/cli/_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/cli/_util.py b/spacy/cli/_util.py index 4289df856..b328025ed 100644 --- a/spacy/cli/_util.py +++ b/spacy/cli/_util.py @@ -57,13 +57,14 @@ def parse_config_overrides(args: List[str]) -> Dict[str, Any]: 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 - value = True + value = "true" else: value = args.pop(0) # Just like we do in the config, we're calling json.loads on the # values. But since they come from the CLI, it'd b unintuitive to # explicitly mark strings with escaped quotes. So we're working # around that here by falling back to a string if parsing fails. + # TODO: improve logic to handle simple types like list of strings? try: result[opt] = srsly.json_loads(value) except ValueError: