clikt
clikt copied to clipboard
Advanced help message formatting?
Is there a possiblity to format the help message with your own paragraphs and font styles like bold or italic ?
I'd like to add examples to my cli and I'm struggling to print pretty examples to the help.
For instance, this is my current help message:
...
CliktCommand(help = """
|Remove Command.
|
|This is my help message.
| Mulitple lines """.trimMargin(),
epilog = """
| EXAMPLES:
|
| 1.) COMMAND remove
| => Removes ALL available instances.
|
| 2.) COMMAND remove -a myalias
| => Removes only instances with ALIAS "myalias".
""".trimMargin(),
...
But the output looks like: (The 2.) doesn't make a new line before '=>')
EXAMPLES:
1.) COMMAND remove
=> Updates ALL available instances.
2.) COMMAND remove -a myalias => Removes only instances with ALIAS "myalias".
Isn't it possible to do something like the OPTIONS, but just for Examples or my own text ?
-o, --option option help message with tab indentation
-p, --port port help message with tab indentatin and multiple
lines
Thanks
The triple backticks did the trick :) Found it here in the documentation: https://ajalt.github.io/clikt/documenting/#preformatting-paragraphs Unfortunately the whitespaces don't remain.
Unfortunately the whitespaces don't remain.
Can you give an example of what you're trying?
The 4.0 uses mordant for output, which can format help how you'd like.