.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "text2usage l"
.TH text2usage l 2026-05-07 " " " "
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
text2usage \- create a usage function from text documentation
.SH SYNOPSIS
.IX Header "SYNOPSIS"
text2usage [options] [input file]
.SH OPTIONS
.IX Header "OPTIONS"
.IP "\-\-name <function_name>" 8
.IX Item "--name <function_name>"
By default text2usage creates a function with the name \f(CW\*(C`usage\*(C'\fR. This'll
change that.
.IP \-\-nopage 8
.IX Item "--nopage"
By default the usage routine will send the documentation to a pager.
This turns that off (why?).
.IP \-\-test 8
.IX Item "--test"
If present, generates a \f(CWmain()\fR function so the mess can be compiled
and you can see what the output will look like.
.IP \-\-pfx 8
.IX Item "--pfx"
The prefix to be used when creating the output files.  Required.
.IP "\-\-csfx <suffix>" 8
.IX Item "--csfx <suffix>"
The suffix (period included) to be used when creating the output file
containing the code.  This defaults to \f(CW\*(C`.c\*(C'\fR.
.IP \-\-f77w 8
.IX Item "--f77w"
Create a function callable from F77.  This interfaces with the GNU
\&\fBautoconf\fR F77 wrappers, and requires there be a \fIconfig.h\fR include
file which defines the \f(CW\*(C`F77_FUNC\*(C'\fR macro.
.IP "\-\-hsfx <suffix>" 8
.IX Item "--hsfx <suffix>"
The suffix (period included) to be used for the output file containing
the header.  This defaults to \f(CW\*(C`.h\*(C'\fR
.IP \-\-help 8
.IX Item "--help"
What you see here.
.IP \-\-version 8
.IX Item "--version"
Print the version and terminate.
.SH DESCRIPTION
.IX Header "DESCRIPTION"
\&\fBtext2usage\fR 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 \f(CW\*(C`PAGER\*(C'\fR).  The \f(CW\*(C`\-\-nopage\*(C'\fR option changes this.
.PP
\&\fBtext2usage\fR will read the text on its standard input stream by
default if the filename is not given on the command line.
.PP
The code is written to \f(CW\*(C`${pfx}${csfx}\*(C'\fR, the header file is
written to \f(CW\*(C`${pfx}{$hsfx}\*(C'\fR.
.PP
The routine will have the name \f(CW\*(C`usage\*(C'\fR; this may be changes with
the \f(CW\*(C`\-\-name\*(C'\fR option.
.SH EXAMPLES
.IX Header "EXAMPLES"
.Vb 1
\&  text2usage \-\-pfx=snack docs.txt
.Ve
.PP
produces the files \f(CW\*(C`snack.c\*(C'\fR and \f(CW\*(C`snack.h\*(C'\fR
.PP
.Vb 1
\&  text2usage \-\-pfx=snack \-\-csfx=.cc docs.txt
.Ve
.PP
produces the files \f(CW\*(C`snack.cc\*(C'\fR and \f(CW\*(C`snack.h\*(C'\fR
.SH VERSION
.IX Header "VERSION"
This documents version 1.1.3 of \fBtext2usage\fR.
.SH "COPYRIGHT AND LICENSE"
.IX Header "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>.
.SH AUTHOR
.IX Header "AUTHOR"
Diab Jerius (djerius@cfa.harvard.edu)
