improve CLI help text and example formatting, fix CLI ref docs formatting#396
Merged
Conversation
…ting On-behalf-of: @SAP christoph.mewes@sap.com
mjudeikis
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is an alternative approach to #392. This PR also chiefly fixes the wrong list syntax in the help text (a missing empty line between a paragraph and a list is wrong Markdown, after all), but then deviates by removing part of the old code:
We had code that would try to collapse multiple lines like
into
hello world here i am, but this would always destroy lists. Also, theFitTerminalwas never used anywhere, so the current logic was trying to create long lines without word-wrapping and letting the terminal wrap them.I tried to find a nice markdown parser/formatter that would allow us to reflow the help texts properly, but found none that worked for me.
Since the line-collapsing would interfere with lists, I removed it. And since applying a word-wrapping later would also interfere with long list items, I instead chose the middleway of having the markdown help texts be pre-wrapped at ~80 characters already. The pre-word-wrapped help texts also look nice in code and work nice on wide terminals where using the full-width might not even be desired.
With that change, all we need to do is remove the indentation to make the docs appear nicer in the CLI output. Note that I tried to replace
heredocwithdedent(to save one dependency; dedent also from the reflow module, which we already have), but dedent produces bad output (muesli/reflow#72), so heredoc remains as our method of choice of removing indentation.Lastly I also made the examples look a bit nicer by reducing their indentation in the CLI output. To make the generated docs look nice, too, this fixed indentation for examples is removed by the cli-doc generator.
End result:
I also fixed the old naming of "initCmd", plus the examples for "bind dev create" contained "dev" twice.
What Type of PR Is This?
/kind cleanup
Release Notes