From 12845f449cff81c37c646ecf0c6b7269de71f190 Mon Sep 17 00:00:00 2001 From: euxane Date: Sat, 30 Nov 2024 10:03:41 +0100 Subject: cli: reject invalid option choices --- main.nim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main.nim') diff --git a/main.nim b/main.nim index cca5528..115808d 100644 --- a/main.nim +++ b/main.nim @@ -61,17 +61,20 @@ proc main() = of "log10": scale = log10 of "ln": scale = ln of "linear", "lin": scale = (val: float) => val + else: raise newException(ValueError, "Unrecognised scale choice") of "symbols": case val: of "unicode", "utf8", "utf-8": symbols = UNICODE_SYMBOLS of "numeric", "ascii": symbols = NUMERIC_SYMBOLS + else: raise newException(ValueError, "Unrecognised symbols choice") of "timestamp": case val: of "datetime", "date-time": timestampHeader = formatTimestampDateTime of "unix", "epoch": timestampHeader = formatTimestampUnix of "none", "false": timestampHeader = formatTimestampNone + else: raise newException(ValueError, "Unrecognised timestamp choice") of "range": let parts = val.split(':', 1) -- cgit v1.2.3