You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve whatis and search output readability: wrap to terminal width and stop repeating the module name #720
The whatis and search sub-commands report the module-whatis lines of matching modulefiles with one output line per whatis entry, each prefixed by the module name right-aligned in a fixed-width column:
------------------- /path/to/modulefiles -------------------
app/1.0: Application for data processing
app/1.0: Built with GCC 12 and OpenMPI 4
app/1.0: Website: https://example.com/app
app/2.0: Application for data processing
Two aspects make this output hard to read:
Long whatis text is printed as a single line without regard to the terminal width. Terminals wrap it at an arbitrary character, breaking words and leaving the continuation flush left under the name column, which visually mixes it with the next entry. Sites that write complete descriptions, or several sentences in one module-whatis call, get output that is hard to scan.
When a modulefile defines several module-whatis lines, the module name is repeated on each one. The repetition adds noise, makes it harder to see where one module ends and the next begins, and the useful information (the description) is pushed to the right and visually diluted.
The need is to render whatis and search results in a way that stays readable in a terminal:
wrap the description text to the terminal column size, with continuation lines indented so they stay aligned under the start of the description and remain clearly attached to their module,
print the module name once for a given modulefile, with its successive whatis lines grouped below or beside it, so that a module with several lines reads as one block,
keep the output identical when it is not sent to a terminal, or offer a way to get the current one-line-per-entry format, so that scripts parsing whatis or search output are not broken.
The avail and list sub-commands already take the terminal width into account for their column layout, so applying the same care to whatis and search output would be consistent with the rest of the command.
This would make module descriptions actually readable in the terminal, which is the point of whatis and search, and would improve the first impression users get when exploring an available software stack.
Activity