Support default values for seq[T] parameters
This commit is contained in:
parent
f091a70a5b
commit
c222804b3b
|
@ -570,7 +570,11 @@ template setField[T](loc: var T, val: Option[TaintedString], defaultVal: untyped
|
|||
else: FieldType(defaultVal)
|
||||
|
||||
template setField[T](loc: var seq[T], val: Option[TaintedString], defaultVal: untyped) =
|
||||
loc.add parseCmdArgAux(type(loc[0]), val.get)
|
||||
if val.isSome:
|
||||
loc.add parseCmdArgAux(type(loc[0]), val.get)
|
||||
else:
|
||||
type FieldType = type(loc)
|
||||
loc = FieldType(defaultVal)
|
||||
|
||||
proc makeDefaultValue*(T: type): T =
|
||||
discard
|
||||
|
|
Loading…
Reference in New Issue