diff --git a/src/hwylterm/hwylcli.nim b/src/hwylterm/hwylcli.nim index 6c2633d..b91b5a7 100644 --- a/src/hwylterm/hwylcli.nim +++ b/src/hwylterm/hwylcli.nim @@ -104,22 +104,24 @@ func render*(cli: HwylCliHelp, subcmd: HwylSubCmdHelp): string = func render*(cli: HwylCliHelp): string = if cli.header != "": result.add cli.header - if cli.usage != "": result.add "\n\n" + if cli.usage != "": result.add "[" & cli.styles.header & "]" result.add "usage[/]:\n" result.add indent(cli.usage, 2 ) + result.add "\n" if cli.description != "": - result.add "\n\n" + result.add "\n" result.add cli.description + result.add "\n" if cli.subcmds.len > 0: - result.add "\n\n" + result.add "\n" result.add "[" & cli.styles.header & "]" result.add "subcommands[/]:\n" for s in cli.subcmds: result.add cli.render(s) + result.add "\n" if cli.flags.len > 0: - result.add "\n\n" result.add "[" & cli.styles.header & "]" result.add "flags[/]:\n" for f in cli.flags: diff --git a/tests/example.nim b/tests/example.nim index 9da1971..0afa866 100644 --- a/tests/example.nim +++ b/tests/example.nim @@ -33,7 +33,8 @@ hwylCli: echo fmt"{yes=}, {color=}" subcommands: [one] - ... """ + help: + description """ the first subcommand this command features both an enum flag and a Count flag