nim-codex/tests/integration/clioption.nim

11 lines
260 B
Nim

type
CliOption* = object
key*: string # option key, including `--`
value*: string # option value
proc `$`*(option: CliOption): string =
var res = option.key
if option.value.len > 0:
res &= "=" & option.value
return res