mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
boolean --config are now case insensitive, refs #284
This commit is contained in:
parent
f722b0a730
commit
b9b9358346
1 changed files with 2 additions and 2 deletions
|
|
@ -41,12 +41,12 @@ class Config(click.ParamType):
|
||||||
# Type checking
|
# Type checking
|
||||||
default = DEFAULT_CONFIG[name]
|
default = DEFAULT_CONFIG[name]
|
||||||
if isinstance(default, bool):
|
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(
|
self.fail(
|
||||||
'"{}" should be on/off/true/false'.format(name), param, ctx
|
'"{}" should be on/off/true/false'.format(name), param, ctx
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
return name, value in ('on', 'true', '1')
|
return name, value.lower() in ('on', 'true', '1')
|
||||||
elif isinstance(default, int):
|
elif isinstance(default, int):
|
||||||
if not value.isdigit():
|
if not value.isdigit():
|
||||||
self.fail(
|
self.fail(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue