mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2024-11-16 06:28:32 -06:00
improve newlines in help output
This commit is contained in:
parent
c0611a728c
commit
0c55d85bda
1 changed files with 4 additions and 4 deletions
|
@ -61,14 +61,14 @@ func render*(cli: HwylCliHelp, f: HwylFlagHelp): string =
|
||||||
if f.short != "":
|
if f.short != "":
|
||||||
result.add "[" & cli.styles.flagShort & "]"
|
result.add "[" & cli.styles.flagShort & "]"
|
||||||
result.add "-" & f.short.alignLeft(cli.shortArgLen)
|
result.add "-" & f.short.alignLeft(cli.shortArgLen)
|
||||||
result.add "[/]"
|
result.add "[/" & cli.styles.flagShort & "]"
|
||||||
else:
|
else:
|
||||||
result.add " ".repeat(1 + cli.shortArgLen)
|
result.add " ".repeat(1 + cli.shortArgLen)
|
||||||
result.add " "
|
result.add " "
|
||||||
if f.long != "":
|
if f.long != "":
|
||||||
result.add "[" & cli.styles.flagLong & "]"
|
result.add "[" & cli.styles.flagLong & "]"
|
||||||
result.add "--" & f.long.alignLeft(cli.longArgLen)
|
result.add "--" & f.long.alignLeft(cli.longArgLen)
|
||||||
result.add "[/]"
|
result.add "[/" & cli.styles.flagLong & "]"
|
||||||
else:
|
else:
|
||||||
result.add " ".repeat(2 + cli.longArgLen)
|
result.add " ".repeat(2 + cli.longArgLen)
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ func render*(cli: HwylCliHelp, f: HwylFlagHelp): string =
|
||||||
if f.description != "":
|
if f.description != "":
|
||||||
result.add "[" & cli.styles.flagDesc & "]"
|
result.add "[" & cli.styles.flagDesc & "]"
|
||||||
result.add f.description
|
result.add f.description
|
||||||
result.add "[/]"
|
result.add "[/" & cli.styles.flagDesc & "]"
|
||||||
result.add "\n"
|
result.add "\n"
|
||||||
|
|
||||||
func render*(cli: HwylCliHelp, subcmd: HwylSubCmdHelp): string =
|
func render*(cli: HwylCliHelp, subcmd: HwylSubCmdHelp): string =
|
||||||
|
@ -101,8 +101,8 @@ func render*(cli: HwylCliHelp): string =
|
||||||
result.add "\n"
|
result.add "\n"
|
||||||
result.add cli.desc
|
result.add cli.desc
|
||||||
result.add "\n"
|
result.add "\n"
|
||||||
result.add "\n"
|
|
||||||
if cli.subcmds.len > 0:
|
if cli.subcmds.len > 0:
|
||||||
|
result.add "\n"
|
||||||
result.add "[" & cli.styles.header & "]"
|
result.add "[" & cli.styles.header & "]"
|
||||||
result.add "subcommands[/]:\n"
|
result.add "subcommands[/]:\n"
|
||||||
for s in cli.subcmds:
|
for s in cli.subcmds:
|
||||||
|
|
Loading…
Reference in a new issue