Make --help and report output fit an 80-column terminal - #10
Merged
Conversation
Every script's --help overflowed 80 columns -- 40 lines across 12 scripts. A heredoc is emitted verbatim, so nothing reflows it the way PowerShell's Get-Help reflows a description: an over-long line wraps mid-word in a default terminal, and the generated ones get worse on their own. The worst were not written long, they grew. fix_dnf_lock interpolated its lock path list straight into the heredoc and printed 216 columns; fix_apt_lock did the same at 106 and clean_logs at 101, and each would gain another column-run every time a default gained an entry. Those three now go through a wrap_list helper, which folds a whitespace-separated list into indented lines within a width budget. clean_logs uses it for the runtime "Patterns" line too, with continuations indented to the label so they line up under the first pattern rather than under the label. The rest is reflowed prose and option text, plus five log messages shortened to fit. Those were shortened rather than wrapped on purpose: a log line is one event, and folding it would break both grep and the log file. What is deliberately left long: file paths in the fix_permissions change list, the exact useradd argv in the exporter installer's dry run, and free(1)'s memory table. Those are data, not prose. Wrapping a path makes it un-copy-pasteable and un-greppable, and reformatting another program's output would be worse than letting the terminal wrap it. tests/run_checks.sh gains a width check, because this accumulated unnoticed precisely for want of one. Verified it fails on a deliberately over-long line and passes on the tree as it stands. Also audited and found already correct, so unchanged: no escape sequences leak when stdout is not a terminal, NO_COLOR and --color never are both honoured, every colour start has a matching reset across every script, --help goes to stdout while errors go to stderr, and an unknown flag exits 2 everywhere. The PowerShell comment-based help runs 81-88 columns in source, but Get-Help reflows description text to the console width, so those are not emitted verbatim the way a heredoc is. No pwsh here to confirm that against, so they are left alone rather than churned on an untested assumption. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
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.



A UI audit of every script's terminal output. One real defect, found in 40 places; everything else audited was already correct.
Width
Every script's
--helpoverflowed 80 columns. A heredoc is emitted verbatim — nothing reflows it the way PowerShell'sGet-Helpreflows a description — so an over-long line wraps mid-word in a default terminal.The worst were not written long, they grew.
fix_dnf_lockinterpolated its lock-path list straight into the heredoc and printed 216 columns;fix_apt_lockdid the same at 106 andclean_logsat 101, and each gains another column-run every time a default gains an entry. Those go through a newwrap_listhelper.clean_logsuses it for the runtimePatternsline too, with continuations indented to line up under the first pattern.The rest is reflowed prose, plus five log messages shortened. Those were shortened rather than wrapped deliberately: a log line is one event, and folding it breaks both
grepand the log file.Left long on purpose
File paths in the
fix_permissionschange list, the exactuseraddargv in the exporter installer's dry run, andfree(1)'s memory table. Those are data, not prose — wrapping a path makes it un-copy-pasteable and un-greppable, and reformatting another program's output would be worse than letting the terminal wrap it.Audited and already correct — unchanged
NO_COLORand--color neverboth honoured;--color alwaysworks through a pipe.--helpgoes to stdout, errors to stderr, unknown flag exits 2 — everywhere.free's own output).Regression guard
tests/run_checks.shgains a width check, since this accumulated unnoticed precisely for want of one. Verified it fails on a deliberately over-long line and passes on the tree as it stands.PowerShell
Comment-based help runs 81–88 columns in source, but
Get-Helpreflows description text to the console width, so it is not emitted verbatim the way a heredoc is. There is nopwshon this machine to confirm that against, so those files are left alone rather than churned on an untested assumption.