text2usage - create a usage function from text documentation
text2usage [options] [input file]
By default text2usage creates a function with the name usage
. This'll
change that.
By default the usage routine will send the documentation to a pager. This turns that off (why?).
If present, generates a main()
function so the mess can be compiled
and you can see what the output will look like.
By default, the output code is written to the standard output stream. This diverts it to a file with this prefix, and with the suffix given by the --csfx option.
This option directs text2usage to produces an include
file as
well as the code. You must specify the --pfx option as well as this
one. The resultant file will have the suffix produced by --hsfx.
The suffix (period included) to be used when creating an output file
for the code. This defaults to .c
.
Create a function callable from F77. This interfaces with the GNU
autoconf F77 wrappers, and requires there be a config.h include
file which defines the F77_FUNC
macro. The --inc option is
ignored in this mode.
The suffix (period included) to be used when creating an include file.
This defaults to .h
What you see here.
Print the version and terminate.
text2usage takes an input text file and creates code which will
spit it back out. The characters are turned into their ASCII integer
representation to avoid funkiness with the compiler. The code
will by default send the text to a pager (paying attention to the
environtmental variable PAGER
). The --nopage
option changes this.
text2usage will read the text on its standard input stream by
default if the filename is not given on the command line. It will
write the code to the standard output stream by default. To write it
to a file, specify the --pfx
option (and the --csfx
option to
change the suffix, if required). To generate an include file for the
routine, use the --inc
option. You'll also need to specify the
--pfx
option in that case. The suffix for the include file may
be specified with the --hsfx
option.
The routine will have the name usage
; this may be changes with
the --name
option.
text2usage --pfx=snack docs.txt
produces the file snack.c
.
text2usage --pfx=snack --inc docs.txt
produces the files snack.c
and snack.h
text2usage --pfx=snack --inc -csfx=.cc docs.txt
produces the files snack.cc
and snack.h
This documents version 1.0.1 of text2usage.
This software is copyright the Smithsonian Astrophysical Observatory and is released under the GNU General Public License. You may find a copy at http://www.fsf.org/copyleft/gpl.html.
Diab Jerius (djerius@cfa.harvard.edu)