Repository navigation
Wrap usage descriptions as whole paragraphs - #372
Merged
Merged
Conversation
Each description line was wrapped on its own at 75 columns, so a description split over several source lines, or one line a little over the width, left short leftover rows and ragged line lengths. Description lines that follow each other in one entry now join into one paragraph before wrapping. Header lines and hand-aligned lines are still written as they are and end the paragraph.
Joining every description line ran separate points and lists together,
such as --tint's <ref> forms and --app-template-extract's notes. A line
now continues the paragraph only when it starts with a lowercase letter
or "("; one starting with a capital or a tag starts a new point.
Instead of guessing which description lines continue a sentence, each paragraph in the usage text is now one string that paragraph() wraps; separate strings are separate points or list items, such as --tint's <ref> forms. printStr wraps each string on its own again.
A hand-aligned line was always written as it was, so one wider than the usage width, such as --ansi-override's <slot> list, ran on to the terminal's edge. It still keeps its spacing while it fits; when it doesn't, it wraps with its continuation rows at its own indent.
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.
Usage descriptions wrapped each source line on its own at 75 columns. A description split over several lines, or a line a little over the width, left short leftover rows and ragged line lengths, as in
-c statusand the server and web server commands. Long hand-aligned lines, such as--ansi-override's<slot>list, weren't wrapped at all and ran to the terminal's edge.paragraph()wraps. Separate strings are separate points or list items, such as--tint's<ref>forms.printStrwraps each string on its own.The rendered usage differs from before only where a ragged paragraph now flows evenly or a long line now wraps. A new test checks that every description row fits the width, that a paragraph flows evenly, that list items stay on their own rows, and that a long hand-aligned line wraps at its indent. Confirmed live on a Linux test host.