Skip to content

A command's Long wraps to the terminal, and keeps its shape - #902

Merged
David-Noble-at-work merged 1 commit into
developfrom
feature/759-long-wraps
Sep 21, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
feature/759-long-wraps

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lane 15 of #887.

  • Long reflows to the terminal (#759) — under
    one convention every Long in the tree already follows: an unindented line is prose and joins its neighbors
    into a paragraph wrapped to displayWidth(); an indented line is structure — a ladder, a table, a list, an
    example — 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. wrappedLong sits beside wrappedFlagUsages on the shared root's help template.
    Man pages and the generated reference read Long as authored. §12 of the specification states the rule.

Test plan

  • make check green; make test-scenario green
  • Coverage, complexity and size re-measured; figures in the plan
  • darwin, installed: COLUMNS=60 writ status --help | awk 'length > 60' prints nothing; writ workflow verify,
    writ deploy and writ reconcile keep their ladders and tables at 60; lore search --help shows the reflowed
    tail
  • danoble-ud24-1.local (linux/arm64), snapshotted first: self install; repo unset/set by URL and by path;
    deploy under stop refuses 9 occupied targets, under --conflict=replace deploys 166 files; upgrade 0;
    --help at COLUMNS=60: no line of Long over 60, the policy ladder one entry per line
  • danoble-wd11-3.local (windows/arm64), snapshotted first: the same repo steps; deploy needs --allow-dirty
    there (the machine's personal checkout is dirty), then stop refuses one occupant and --conflict=replace
    deploys 74 links; upgrade 0; --help at 60 keeps the ladder

Time

Marker UTC Elapsed
opened (first commit) 2026-09-21T11:20:58Z —
submitted (PR opened) 2026-09-21T11:21:06Z 0 h after opened
merged 2026-09-21T11:33:53Z 0.2 h after submitted; 0.2 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

https://claude.ai/code/session_01SqQVFZz7AdiLZkGoAcUqRW

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant