mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2024-12-21 10:40:44 -06:00
support other default sep char
This commit is contained in:
parent
c5f70cec4e
commit
ef573dc0f8
2 changed files with 6 additions and 6 deletions
|
@ -744,7 +744,7 @@ proc parse*(p: OptParser, target: var float) =
|
|||
proc parse*[T](p: var OptParser, target: var seq[T]) =
|
||||
checkVal p
|
||||
case p.sep
|
||||
of ",=":
|
||||
of ",=", ",:":
|
||||
let baseVal = p.val
|
||||
for v in baseVal.split(","):
|
||||
p.val = v.strip()
|
||||
|
@ -752,7 +752,7 @@ proc parse*[T](p: var OptParser, target: var seq[T]) =
|
|||
var parsed: T
|
||||
parse(p, parsed)
|
||||
target.add parsed
|
||||
of "=", "":
|
||||
of "=",":","":
|
||||
var parsed: T
|
||||
parse(p, parsed)
|
||||
target.add parsed
|
||||
|
|
|
@ -72,16 +72,16 @@ hwylCli:
|
|||
flags:
|
||||
^something
|
||||
thing:
|
||||
T KV[string, Color]
|
||||
? "some key value string"
|
||||
T seq[KV[string, Color]]
|
||||
? "some key value colors"
|
||||
b:
|
||||
T seq[float]
|
||||
? "multiple floats"
|
||||
h "this will override the builtin 'h' for help"
|
||||
def:
|
||||
T string
|
||||
? "a flag with a string default"
|
||||
* "the value"
|
||||
run:
|
||||
echo "hello from `example b` command"
|
||||
echo fmt"{thing=}, {b=}, {h=}, {def=}"
|
||||
echo fmt"{thing=}, {b=}, {def=}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue