2024-09-17 17:28:21 -05:00
|
|
|
import std/[
|
|
|
|
unittest
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-14 12:01:56 -06:00
|
|
|
import hwylterm, hwylterm/hwylcli
|
2024-09-17 17:28:21 -05:00
|
|
|
|
|
|
|
suite "cli":
|
2024-09-30 17:23:52 -05:00
|
|
|
test "cli":
|
|
|
|
let expected = """[b]test-program[/] [[args...]
|
|
|
|
|
|
|
|
[b cyan]flags[/]:
|
|
|
|
[yellow]-h[/] [magenta]--help [/] []show this help[/]
|
|
|
|
[yellow]-V[/] [magenta]--version[/] []print version[/]
|
|
|
|
"""
|
2024-11-14 12:01:56 -06:00
|
|
|
let cli =
|
|
|
|
newHwylCliHelp(
|
|
|
|
header = "[b]test-program[/] [[args...]",
|
|
|
|
flags = [("h","help","show this help",),("V","version","print version")]
|
|
|
|
)
|
|
|
|
check $bb(cli) == $bb(expected)
|