binman - man pages for bin scripts
binman
[OPTION]... COMMAND
binman produces UNIX manual pages for your executable scripts. It can extract their leading comment headers (defined below), convert them from markdown(7) into roff(7) using md2man, and display them using man(1).
A leading comment header can be one of the following two things:
A contiguous sequence of single-line comments (which begin with #
and optionally continue with a single space followed by any number of
characters until the end of the line) starting at the beginning of the
file (after shebang and encoding comments plus optional blank lines) and
ending at the first single blank line.
The first embedded document delimited by =begin
and =end
lines, which
begin with the respective delimiters and optionally continue with a single
space followed by any number of characters until the end of the line.
Although your leading comment headers are written in markdown(7), binman
conv
inherits the following additions to markdown(7) syntax from md2man(5):
There can be at most one top-level heading (H1). It is emitted as .TH
in the roff(7) output to define the UNIX manual page's header and footer.
Paragraphs whose lines are all uniformly indented by two spaces are
considered to be "indented paragraphs". They are unindented accordingly
before emission as .IP
in the roff(7) output.
Paragraphs whose subsequent lines (all except the first) are uniformly
indented by two spaces are considered to be a "tagged paragraphs". They
are unindented accordingly before emission as .TP
in the roff(7) output.
The following Redcarpet extensions are enabled while processing markdown(7):
-h
, --help
help
FILE ... [-h
|--help
[REGEXP]] ... [--
] ...-h
or --help
, except after
--
, optionally followed by a REGEXP regular expression that specifies
text to search for and, if found, jump to inside the displayed man page,
then this program extracts the given FILE's leading comment header,
converts it into roff(7), displays it using man(1), and finally exits with
status code 0
. Otherwise, this program exits with status code 111
.show
[FILE] [REGEXP]load
[FILE]dump
[FILE]conv
[FILE]