AUTOGEN(1)

NAME
autogen - The Automated Program Generator

SYNOPSIS
autogen [-flag [value]]... [--opt-name [[=| ]value]]...
[ <def-file> ]

DESCRIPTION
This manual page documents, briefly, the autogen command. AutoGen is a tool designed for generating program files that contain repetitive text with varied substitutions. Its goal is to simplify the maintenance of programs that contain large amounts of repetitious text. This is especially valuable if there are several blocks of such text that must be kept synchronized.

One common example is the problem of maintaining the code required for processing program options. Processing options requires a minimum of four different constructs be kept in proper order in different places in your program. You need at least: The flag character in the flag string, code to process the flag when it is encountered, a global state variable or two, and a line in the usage text. You will need more things besides this if you choose to implement long option names, rc/ini file processing, environment variables and so on. All of this can be done mechanically; with the proper templates and this program.

OPTIONS

-L dir, --templ-dirs=dir
    Template search directory list. Special attributes apply to this option. See the invocation section in the info document.

    Add a directory to the list of directories to search when opening a template, either as the primary template or an included one.

-T tpl-file, --override-tpl=tpl-file
    Override template file. Special attributes apply to this option. See the invocation section in the info document.

    Definition files specify the standard template that is to be expanded. This option will override that name and expand a different template.

-b name, --base-name=name
    Base name for output file(s). Special attributes apply to this option. See the invocation section in the info document.

    A template may specify the exact name of the output file. Normally, it does not. It is, instead, the base name of the definitions file, with suffixes removed. If the definitions are being read from standard in or there is some other reason for using a different base file name, then use this option.

-s suffix, --skip-suffix=suffix
    Omit the file with this suffix. Special attributes apply to this option. See the invocation section in the info document.

    Occasionally, it may not be desirable to produce all of the output files specified in the template. (For example, only the .h header file, but not the .c program text.) To do this specify --skip-suffix=c on the command line.

--equate=char-list
    characters considered equivalent

    This option will alter the list of characters considered equivalent. The default are the three characters, "_-^". (The latter is conventional on a Tandem, and I do a lot of work on the Tandem.)

--loop-limit=lim
    Limit on increment loops

    This option prevents runaway loops. For example, if you accidentally specify, "_FOR x FROM 1 TO -1 BY 1", it will take a long time to finish. If you do have more than 256 entries in tables, you will need to specify a new limit with this option.

-t time-lim, --timeout=time-lim
    Time limit for servers

    AutoGen works with a shell server process. Most normal commands will complete in less than 10 seconds. If, however, your commands need more time than this, use this option.

-D name-value, --define=name-value
    name to add to definition list. Special attributes apply to this option. See the invocation section in the info document.

    Just like 'C', AutoGen uses #ifdef/#ifndef preprocessing directives. This option will cause the name to be added to the list of defined values. If you supply a define value as well, it can be used in the template with the _ENV expression function.

-U name-pat, --undefine=name-pat
    definition list removal pattern. Special attributes apply to this option. See the invocation section in the info document.

    Just like 'C', AutoGen uses #ifdef/#ifndef preprocessing directives. This option will cause the name to be removed from the list of defined values.

-?, --help
    Display usage information and exit.

-!, --more-help
    Extended usage information passed thru pager.

-> rcfile, --save-opts[=rcfile]
    Save the option state to rcfile.

-< rcfile, --load-opts=rcfile
    Load options from rcfile.

--no-load-opts
    Disable loading options from an rc file.

-v [v|c|n], --version[=v|c|n]
    Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice.

If "<def-file>" is "-" or not specified, standard in is assumed. The default "base-name" is the "<def-file>" with suffixes removed. However, the template file may specify the output file names. "loop-limit" is used in debugging to stop runaway expansions.

SEE ALSO
This program is documented more fully in the AutoGen Info system documentation.

EXAMPLES
autogen -T man.tpl --base-name=autogen opts.def

This command produced this man page from the AutoGen option definition file. It overrides the template specified in opts.def (normally options.tpl) and uses man.tpl. It also overrides the base-name of the output file, which is normally derived from the input definition file name (viz. opts).

AUTHOR
Bruce Korb <bkorb@gnu.org>

This manual page was AutoGen-erated from the AutoGen option definitions.