From 9df9f0c41ea6aa59cb34151c0505f6fae36ef12e Mon Sep 17 00:00:00 2001 From: euxane Date: Mon, 25 Nov 2024 01:09:48 +0100 Subject: cli: combine min/max into range arg --- main.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main.nim') diff --git a/main.nim b/main.nim index e93e144..3128bac 100644 --- a/main.nim +++ b/main.nim @@ -66,8 +66,10 @@ proc main() = of "unicode", "utf8", "utf-8": symbols = UNICODE_SYMBOLS of "numeric", "ascii": symbols = NUMERIC_SYMBOLS - of "min": min = parseInt(val) - of "max": max = parseInt(val) + of "range": + let parts = val.split(':', 1) + if parts.len != 2: raise newException(ValueError, "Invalid range") + (min, max) = (parseInt(parts[0]), parseInt(parts[1])) of "ping": let targetIp = resolve(val) -- cgit v1.2.3