NAME

text2usage - create a usage function from text documentation


SYNOPSIS

text2usage [options] [input file]


OPTIONS

--name <function_name>

By default text2usage creates a function with the name usage. This'll change that.

--nopage

By default the usage routine will send the documentation to a pager. This turns that off (why?).

--test

If present, generates a main() function so the mess can be compiled and you can see what the output will look like.

--pfx

The prefix to be used when creating the output files.

--csfx <suffix>

The suffix (period included) to be used when creating the output file containing the code. This defaults to .c.

--f77w

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.

--hsfx <suffix>

The suffix (period included) to be used for the output file containing the header. This defaults to .h

--help

What you see here.

--version

Print the version and terminate.


DESCRIPTION

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.


EXAMPLES

  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


VERSION

This documents version 1.1.0 of text2usage.


COPYRIGHT AND LICENSE

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.


AUTHOR

Diab Jerius (djerius@cfa.harvard.edu)