1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-10 09:21:58 +02:00

doc: ls: support styling and links in --help output

* src/ls.c (oputs): A new function that wraps puts(),
but also highlights the --option-text portion, and
adds links to the appropriate part of the online manual.
(usage): Call oputs() rather than puts().
* doc/coreutils.texi (--help): Document new HELP_NO_MARKUP env var,
which can be used in the edge case one wants to suppress ansi escapes.
* tests/misc/getopt_vs_usage.sh: Use HELP_NO_MARKUP to ensure the
test continues to pass.
This commit is contained in:
Pádraig Brady
2025-11-25 13:40:32 +00:00
parent 88760f9c10
commit d5e15b2f29
3 changed files with 172 additions and 78 deletions

View File

@@ -764,8 +764,12 @@ these programs, abbreviations of the long options are not always recognized.
@item --help
@opindex --help
@vindex HELP_NO_MARKUP
@cindex help, online
Print a usage message listing all available options, then exit successfully.
Help output may be marked up with terminal codes for formatting or
hyperlinks, which can be disabled by setting the @env{HELP_NO_MARKUP}
environment variable.
@item --version
@opindex --version