diff options
author | bptato <nincsnevem662@gmail.com> | 2023-11-26 14:48:30 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-11-26 14:48:30 +0100 |
commit | efae976719521ca4ed0bc7f99425a1700d3d9029 (patch) | |
tree | 15cdeb713c71701fc6a89d44d713cf9d6b8ed2f1 /src/config | |
parent | a386b78fdc61b791b6df649326078383098bef5a (diff) | |
download | chawan-efae976719521ca4ed0bc7f99425a1700d3d9029.tar.gz |
config: add bare aliases for "8bit", "24bit"
Without this, setting color-mode using -o required quoting the values, and then shell-quoting the quotes themselves (cha -o 'display-color-mode="24bit"'). Instead of more special casing in the TOML parser, we just add aliases for these enum values that can be parsed using TOML bare string rules. So now this works: cha -o display.color-mode=true-color
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/config.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/config/config.nim b/src/config/config.nim index 99f9d9da..b0e33685 100644 --- a/src/config/config.nim +++ b/src/config/config.nim @@ -495,8 +495,8 @@ proc parseConfigValue(x: var Opt[ColorMode], v: TomlValue, k: string) = of "auto": x.err() of "monochrome": x.ok(MONOCHROME) of "ansi": x.ok(ANSI) - of "8bit": x.ok(EIGHT_BIT) - of "24bit": x.ok(TRUE_COLOR) + of "8bit", "eight-bit": x.ok(EIGHT_BIT) + of "24bit", "true-color": x.ok(TRUE_COLOR) else: raise newException(ValueError, "unknown color mode '" & v.s & "' for key " & k) |