From af24b62e808ff3d1e1f1a149437fbb576cde0bd6 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Thu, 22 Nov 2018 23:15:50 +0200 Subject: [PATCH] Add support for int params --- confutils.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/confutils.nim b/confutils.nim index 2bda826..41506dc 100644 --- a/confutils.nim +++ b/confutils.nim @@ -8,7 +8,13 @@ proc parse*(T: type DirPath, p: TaintedString): T = result = DirPath(p) template parse*(T: type string, s: TaintedString): string = - string(s) + string s + +proc parse*(T: type SomeSignedInt, s: TaintedString): T = + T parseInt(string s) + +proc parse*(T: type SomeUnsignedInt, s: TaintedString): T = + T parseUInt(string s) proc load*(Configuration: type, cmdLine = commandLineParams(),