gitparseopt2helpm - convert a git rev-parse opts_spec string to a HelpMessage
gitparseopt2helpm [options] [--] [file]
gitparseopt2helpm converts a specification of options to be parsed by git rev-parse --parseopt
, and converts it to a simple HelpMessage printed to the standard output.
It file is not given or it is a dash, the specification is read from standard input.
The options are parsed by getopt(1).
Output only a single section (without the title) that lists the options.
If no option spec was found or if the synopsis contains multiple lines the return status is non zero.
Extract an option specification from a script and build a manual page:
$ awk '/^"/ && p {exit}; p {print}; /^OPTS_SPEC="\\/ {p=1}' myprog.sh \
|gitparseopt2helpm |helpm2pod --man >myprog.1
gitparseopt2helpm was written by G.raud Meyer.
git-rev-parse(1), helpmessage(5)