NAME
Getopt::Pad::Help - Renders the help and version output of one level (internal)
DESCRIPTION
This module is internal to Getopt::Pad. It is not part of the public API and can change without notice. Programs use "GetOptions" in Getopt::Pad; this page is for people working on Getopt::Pad itself.
Renders the output of --help and --version for one level: the header with the command path, the Arguments section, one section per option group, the Commands section and the examples. The layout is described for users in "HELP OUTPUT" in Getopt::Pad.
Help renderers are created only by the helperFor method of Getopt::Pad::Spec. The command path in the header is derived from the level itself.
The terminal is consulted when something is rendered, not when the renderer is created: a parse creates one renderer per level without printing anything, and $result->help may run much later. The width comes from COLUMNS, else from Term::ReadKey when the handle is a terminal, else it is 100. Colors are used when the handle is a terminal, NO_COLOR is empty and TERM is not dumb.
Text is wrapped as plain text first and colored afterwards, so the escape codes never affect the column alignment.
METHODS
- new(level => $level, version => $version, programName => $name, width => $columns, color => $bool, handle => $fh)
-
Only
levelis required.programNamedefaults to the file name of$0,handleto STDOUT;widthandcolorare detected when omitted. - renderHelp, printHelp
-
The help text, or print it to the handle.
- renderVersion, printVersion
-
PROGRAM VERSION, where VERSION is the spec'sversion, else$main::VERSION, elseunknown; or print it with a newline.
SEE ALSO
"HELP OUTPUT" in Getopt::Pad, Getopt::Pad::Spec
AUTHOR
davenonymous <perl@davenonymous.com>
COPYRIGHT AND LICENSE
Copyright 2026 davenonymous
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.