make docs more readable

This commit is contained in:
Daylin Morgan 2024-09-25 14:44:55 -05:00
parent 66a6deba46
commit b0be93a7d1
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -19,7 +19,6 @@ type
valtype: string = "red" valtype: string = "red"
args: string = "italic" args: string = "italic"
proc helpAttr(styles: CligenStyle): Table[string, string] = proc helpAttr(styles: CligenStyle): Table[string, string] =
{ {
"cmd" : toAnsiCode(styles.cmd), "cmd" : toAnsiCode(styles.cmd),
@ -41,13 +40,17 @@ proc helpAttrOff(): Table[string,string] =
"args" : resetCode, "args" : resetCode,
}.toTable() }.toTable()
const
useMulti = "${doc}[bold]Usage[/]:\n $command {SUBCMD} [[sub-command options & parameters]\n\n[bold]subcommands[/]:\n$subcmds"
useHdr = "[bold]Usage[/]:\n "
use = "$command $args\n${doc}[bold]Options[/]:\n$options"
proc hwylCli*( proc hwylCli*(
clcfg: var ClCfg, clcfg: var ClCfg,
styles: CligenStyle = CligenStyle(), styles: CligenStyle = CligenStyle(),
useMulti: string = "${doc}[bold]Usage[/]:\n $command {SUBCMD} [[sub-command options & parameters]\n\n[bold]subcommands[/]:\n$subcmds", useMulti: string = useMulti,
useHdr: string = "[bold]usage[/]:\n ", useHdr: string = useHdr,
use: string = "$command $args\n${doc}[bold]Options[/]:\n$options" use: string = use,
) = ) =
if clCfg.useMulti == "": if clCfg.useMulti == "":