helpmselect - filter out sections from a HelpMessage
helpmselect [options] [--] format[-] [file]
helpmselect removes some sections from a HelpMessage read from file or from the standard input. By default all the sections are kept, and none are removed.
If a section matches the ERE (awk Extended Regular Expression) given to --remove, it is removed. Otherwise if it does not match the ERE given to --keep, it is removed. The remaining sections are kept in the standard output. If several identical options are found, the value used is the concatenation of the options separated by spaces.
If --no-header is given, anything that comes before the first section is removed.
The options are parsed by getopt(1).
A non zero exit status would indicate an error for awk itself.
In a shell script, make a usage message from the embedded HelpMessage:
$ helpm4sh $0 2>/dev/null |
helpmselect --no-header --keep 'SYNOPSIS|OPTIONS' |
helpm2text
helpmselect was written by G.raud Meyer.
helpmessage(5), helpm2pod(1), helpm2text(1)