From 0c55d85bda1c36342ddc53a0fb6fcffaffac9a3e Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 11 Nov 2024 14:38:38 -0600 Subject: [PATCH] improve newlines in help output --- src/hwylterm/hwylcli.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hwylterm/hwylcli.nim b/src/hwylterm/hwylcli.nim index b285f94..4e7e1b3 100644 --- a/src/hwylterm/hwylcli.nim +++ b/src/hwylterm/hwylcli.nim @@ -61,14 +61,14 @@ func render*(cli: HwylCliHelp, f: HwylFlagHelp): string = if f.short != "": result.add "[" & cli.styles.flagShort & "]" result.add "-" & f.short.alignLeft(cli.shortArgLen) - result.add "[/]" + result.add "[/" & cli.styles.flagShort & "]" else: result.add " ".repeat(1 + cli.shortArgLen) result.add " " if f.long != "": result.add "[" & cli.styles.flagLong & "]" result.add "--" & f.long.alignLeft(cli.longArgLen) - result.add "[/]" + result.add "[/" & cli.styles.flagLong & "]" else: result.add " ".repeat(2 + cli.longArgLen) @@ -77,7 +77,7 @@ func render*(cli: HwylCliHelp, f: HwylFlagHelp): string = if f.description != "": result.add "[" & cli.styles.flagDesc & "]" result.add f.description - result.add "[/]" + result.add "[/" & cli.styles.flagDesc & "]" result.add "\n" func render*(cli: HwylCliHelp, subcmd: HwylSubCmdHelp): string = @@ -101,8 +101,8 @@ func render*(cli: HwylCliHelp): string = result.add "\n" result.add cli.desc result.add "\n" - result.add "\n" if cli.subcmds.len > 0: + result.add "\n" result.add "[" & cli.styles.header & "]" result.add "subcommands[/]:\n" for s in cli.subcmds: