diff options
author | euxane | 2024-11-25 01:09:48 +0100 |
---|---|---|
committer | euxane | 2024-11-25 01:09:48 +0100 |
commit | 9df9f0c41ea6aa59cb34151c0505f6fae36ef12e (patch) | |
tree | 44f1531319354a89b4689291e5a3024473527466 /main.nim | |
parent | 4cd66c433da6e95ee8869e954f835c5ecf4bd8d0 (diff) | |
download | tickwatch-2.0.tar.gz |
cli: combine min/max into range argv2.0
Diffstat (limited to 'main.nim')
-rw-r--r-- | main.nim | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -66,8 +66,10 @@ proc main() = | |||
66 | of "unicode", "utf8", "utf-8": symbols = UNICODE_SYMBOLS | 66 | of "unicode", "utf8", "utf-8": symbols = UNICODE_SYMBOLS |
67 | of "numeric", "ascii": symbols = NUMERIC_SYMBOLS | 67 | of "numeric", "ascii": symbols = NUMERIC_SYMBOLS |
68 | 68 | ||
69 | of "min": min = parseInt(val) | 69 | of "range": |
70 | of "max": max = parseInt(val) | 70 | let parts = val.split(':', 1) |
71 | if parts.len != 2: raise newException(ValueError, "Invalid range") | ||
72 | (min, max) = (parseInt(parts[0]), parseInt(parts[1])) | ||
71 | 73 | ||
72 | of "ping": | 74 | of "ping": |
73 | let targetIp = resolve(val) | 75 | let targetIp = resolve(val) |