Allow ":set <boolean-flag> = false" and ":set <boolean-flag> = true".

Previously we only allowed enable/disable, on/off, or yes/no.
This commit is contained in:
Brian Huffman 2018-05-21 13:01:53 -07:00
parent 9e3f7ec13f
commit 3a4bc6a2af

View File

@ -597,9 +597,9 @@ setUser name val = case lookupTrieExact name userOptions of
_ -> rPutStrLn ("Failed to parse number for field, `" ++ name ++ "`")
EnvBool _
| any (`isPrefixOf` val) ["enable","on","yes"] ->
| any (`isPrefixOf` val) ["enable", "on", "yes", "true"] ->
writeEnv (EnvBool True)
| any (`isPrefixOf` val) ["disable","off","no"] ->
| any (`isPrefixOf` val) ["disable", "off", "no", "false"] ->
writeEnv (EnvBool False)
| otherwise ->
rPutStrLn ("Failed to parse boolean for field, `" ++ name ++ "`")