hwylterm/tests/cli/clis/subcommands.nim

32 lines
576 B
Nim
Raw Permalink Normal View History

2025-01-23 19:25:09 -06:00
import std/[strformat]
import hwylterm, hwylterm/hwylcli
hwylCli:
name "subcommands"
subcommands:
[a]
... "a subcommand with positionals"
positionals:
input string
outputs seq[string]
run:
echo fmt"{input=} {outputs=}"
2025-01-28 15:58:25 -06:00
2025-01-23 19:25:09 -06:00
[b]
... "a subcommand with flags"
flags:
input:
T string
2025-01-24 17:42:29 -06:00
* "testing"
? "some help after default"
2025-01-23 19:25:09 -06:00
outputs:
T seq[string]
run:
echo fmt"{input=} {outputs=}"
2025-01-28 15:58:25 -06:00
2025-01-27 11:52:53 -06:00
[ccccc]
... "a subcommand with an alias"
alias c
run:
echo "no flags :)"