Repository navigation
Group whatis lines under module name and wrap them to terminal width - #727
Merged
Merged
Conversation
xdelaruelle
force-pushed
the
issue720
branch
2 times, most recently
from
October 31, 2026 09:40
f4f492b to
15d91ea
Compare
The whatis and search sub-commands print one output line per module-whatis entry, each prefixed by the module name right-aligned in a fixed-width column. A long description is sent as a single line that the terminal wraps at an arbitrary character, with the continuation flush left where it visually merges with the next entry. When a modulefile defines several module-whatis lines, the repeated name adds noise and hides where one module ends and the next begins. Report the module name once per matching modulefile, with its first whatis line beside it and the following ones aligned under the start of this text. Wrap text to the terminal width, cutting at whitespace so that words are kept whole and continuation lines stay attached to their module. SGR codes highlighting the search string are not counted in line length. A name longer than its column shifts the text start column for that module only. JSON output is unchanged. Fixes envmodules#720 Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Now that whatis and search group module-whatis lines under a single module name and wrap them to the terminal width, scripts parsing their results have no stable one line per entry format to rely on anymore. Accept the --terse option on both sub-commands, as avail and list already do, to report each module-whatis line on its own output line prefixed by the module name. No padding is added before the module name and no wrapping is applied, so each line holds a complete entry. The modulepath is reported as a header line, like avail does in terse mode. JSON output is unchanged. Fixes envmodules#720 Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
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.
Make
whatisandsearchresults readable in a terminal, and give scripts a stable format to parse.module-whatisline beside it and the following ones aligned under the start of this text. Text is wrapped to the terminal width at whitespace, words are kept whole, and the SGR codes highlighting the search string are not counted in line length. A name longer than its 20-character column shifts the text start column for that module only.--terse(-t) is now supported on both sub-commands: the modulepath is reported as a header line likeavail --tersedoes, then eachmodule-whatisline is reported on its own output line prefixed by the module name, without padding nor wrapping. JSON output is unchanged.Regular output at a 40-column width:
Terse output:
Fixes #720