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.
.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
Diab Jerius (djerius@cfa.harvard.edu)