From b0be93a7d1491a632bd8c43f60a46e8f54457ffc Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 25 Sep 2024 14:44:55 -0500 Subject: [PATCH] make docs more readable --- src/hwylterm/cli.nim | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hwylterm/cli.nim b/src/hwylterm/cli.nim index 16992c9..8cfae5d 100644 --- a/src/hwylterm/cli.nim +++ b/src/hwylterm/cli.nim @@ -19,7 +19,6 @@ type valtype: string = "red" args: string = "italic" - proc helpAttr(styles: CligenStyle): Table[string, string] = { "cmd" : toAnsiCode(styles.cmd), @@ -41,13 +40,17 @@ proc helpAttrOff(): Table[string,string] = "args" : resetCode, }.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*( clcfg: var ClCfg, styles: CligenStyle = CligenStyle(), - useMulti: string = "${doc}[bold]Usage[/]:\n $command {SUBCMD} [[sub-command options & parameters]\n\n[bold]subcommands[/]:\n$subcmds", - useHdr: string = "[bold]usage[/]:\n ", - use: string = "$command $args\n${doc}[bold]Options[/]:\n$options" + useMulti: string = useMulti, + useHdr: string = useHdr, + use: string = use, ) = if clCfg.useMulti == "":