extract_usage_from_stx [ file file ... ]
Process the given files, which should be manpages written in Stx, stripping away everything that is typically not included in a "Usage:" message. If no files are given, read standard input instead.
A "Usage:" message is a message typically printed when a program is called with incorrect arguments or when help is specifically requested, for example with a --help command line option. A "Usage:" message is typically a subset of the information provided on a command's manual page.
The information left in the "Usage:" message by extract_usage_from_stx includes:
- the command synopsis, as given in the "SYNOPSIS" section
- the command line options, as given in the "OPTIONS" section, together with the first sentence of their description. A sentence is taken to end at a period (.).
The output of extract_usage_from_stx is still in Stx format, which you might want to further process to produce the actual "Usage:" message.
- --version, -V
- Just show version information and exit.
- --help, -?
- Just show a short help message and exit.
The end-condition of a sentence is too strong.
This manual page was written by Panu A. Kalliokoski.