text2usage - create a usage function from text documentation
text2usage [options] [input file]
usage
. This'll
change that.
main()
function so the mess can be compiled
and you can see what the output will look like.
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.
.c
.
F77_FUNC
macro. The --inc option is
ignored in this mode.
.h
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.0 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)