Repository navigation
A command's Long wraps to the terminal, and keeps its shape - #902
Merged
Merged
Conversation
Flag usage has reflowed to the terminal since #755; a command's Long still printed verbatim through cobra's help template, hand-wrapped to whatever width its author guessed, so at COLUMNS=60 the flags wrapped at 60 while the description ran to 83. #755 left Long alone because its prose has shape -- writ verify's policy ladder, writ deploy's conflict table, writ reconcile's entry states -- that a word-wrapper would fold into paragraphs. wrapLong reflows Long under one convention every Long in the tree already follows: an unindented line is prose and joins its neighbors into a paragraph wrapped to the width; an indented line is structure and keeps its break and its indent, wrapping only if it is itself too long, hanging under its text column as a usage line does. Authored breaks in prose are not load-bearing; an author who wants a line kept indents it. wrappedLong sits beside wrappedFlagUsages on the shared root's help template, so every command of every program inherits it. Man pages and the generated reference read Long as authored and do not change. Section 12 of the specification states the rule for usage and Long together. Closes #759
This was referenced Sep 23, 2026
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
Lane 15 of #887.
Longreflows to the terminal (#759) — underone convention every
Longin the tree already follows: an unindented line is prose and joins its neighborsinto a paragraph wrapped to
displayWidth(); an indented line is structure — a ladder, a table, a list, anexample — and keeps its break and indent, wrapping only if it is itself too long, hanging under its text column
as Help text does not wrap: pflag is given no width, so every line length is maintained by hand #755's usage lines do.
wrappedLongsits besidewrappedFlagUsageson the shared root's help template.Man pages and the generated reference read
Longas authored. §12 of the specification states the rule.Test plan
make checkgreen;make test-scenariogreenCOLUMNS=60 writ status --help | awk 'length > 60'prints nothing;writ workflow verify,writ deployandwrit reconcilekeep their ladders and tables at 60;lore search --helpshows the reflowedtail
danoble-ud24-1.local(linux/arm64), snapshotted first: self install;repo unset/setby URL and by path;deployunderstoprefuses 9 occupied targets, under--conflict=replacedeploys 166 files;upgrade0;--helpatCOLUMNS=60: no line ofLongover 60, the policy ladder one entry per linedanoble-wd11-3.local(windows/arm64), snapshotted first: the samereposteps;deployneeds--allow-dirtythere (the machine's personal checkout is dirty), then
stoprefuses one occupant and--conflict=replacedeploys 74 links;
upgrade0;--helpat 60 keeps the ladderTime
Computed by the algorithm of noblefactor-ops#188 at merge.
https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW