From b9b93583467986a72f34732fc87a201157ad83ea Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 24 May 2018 22:53:58 -0700 Subject: [PATCH] boolean --config are now case insensitive, refs #284 --- datasette/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datasette/cli.py b/datasette/cli.py index d996708f..ccf3d6bf 100644 --- a/datasette/cli.py +++ b/datasette/cli.py @@ -41,12 +41,12 @@ class Config(click.ParamType): # Type checking default = DEFAULT_CONFIG[name] if isinstance(default, bool): - if value not in ('on', 'off', 'true', 'false', '1', '0'): + if value.lower() not in ('on', 'off', 'true', 'false', '1', '0'): self.fail( '"{}" should be on/off/true/false'.format(name), param, ctx ) return - return name, value in ('on', 'true', '1') + return name, value.lower() in ('on', 'true', '1') elif isinstance(default, int): if not value.isdigit(): self.fail(