
autogen definitions options;

/*
 *   $Id: opts.def,v 2.14 1999/09/29 16:00:21 bkorb Exp $
 */

/*
 *  AutoGen copyright 1992-1999 Bruce Korb
 *
 *  AutoGen is free software.
 *  You may redistribute it and/or modify it under the terms of the
 *  GNU General Public License, as published by the Free Software
 *  Foundation; either version 2, or (at your option) any later version.
 *
 *  AutoGen is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with AutoGen.  See the file "COPYING".  If not,
 *  write to:  The Free Software Foundation, Inc.,
 *             59 Temple Place - Suite 330,
 *             Boston,  MA  02111-1307, USA.
 */

copyright = "1999";
copyright_gpl;

owner          = "Bruce Korb";
eaddr          = "bkorb@gnu.org";
prog_name      = "getdefs";
prog_title     = "AutoGen Definition Extraction Tool";

version        = 1;

flag = {
    name      = "defs_to_get";
    flag_arg  = ":";
    arg_name  = reg-ex;
    descrip   = 'Regexp to look for after the "/*="';
    doc =
    "If you want definitions only from a particular category, or even\n"
    "with names matching particular patterns, then specify this regular\n"
    "expression for the text that must follow the @code{/*=}.";
};

flag = {
    name      = ordering;
    flag_arg; /* optional */
    arg_name  = file-name;
    disable   = no;
    enabled;
    descrip   = "Alphabetize or use named file";
    doc =
    "By default, ordering is alphabetical by the entry name.\n"
    "Use, @code{no-ordering} if order is unimportant.\n"
    "Use @code{ordering} with no argument to order without case sensitivity.\n"
    "Use @code{ordering=<file-name>} if chronological order is important.\n"
    "getdefs will maintain the text content of @code{file-name}.\n"
    "@code{file-name} need not exist.\n";
};

flag = {
    name      = input;
    flag_arg  = ":";
    arg_name  = file;
    max       = NOLIMIT;
    min       = 1;
    stack_arg;
    default;
    descrip   = "Input file to search for defs";
    doc =
    "All files that are to be searched for definitions must be named\n"
    "on the command line.  If an option name is not mentioned in the\n"
    "command line argument, it is presumed to be this option.  There must\n"
    "be at least one.";
};

flag = {
    name      = subblock;
    flag_arg  = ":";
    arg_name  = sub-def;
    max       = NOLIMIT;
    stack_arg;
    descrip   = "subblock definition names";
    doc =
    "This option is used to create shorthand entries for subblocks.\n"
    "For example, with:\n"
    "@*\n@code{subblock=arg=argname,type} defined, the text:\n"
    "@*\n@code{arg: this, char *} will then expand to:\n"
    "@*\n@code{arg = @{ argname = this; type = \"char *\" @};}.\n";
};

flag = {
    name        = filelist;
    flag_arg;     /* optional */
    arg_name    = file;
    descrip     = "Insert source file names into defs";
    doc =
    "Inserts the name of each input file into the output definitions.\n"
    "If no argument is supplied, the format will be:\n"
    "@example\ninfile = '%s';\n@end example\n"
    "If an argument is supplied, that string will be used for the entry\n"
    "name instead of @var{infile}.";
};

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *  Definition Insertion Options:
 */
flag = {
    name        = doc_insert;
    descrip     = "Definition insertion options";
    documentation;
};

flag = {
    name      = assign;
    flag_arg  = ":";
    arg_name  = ag-def;
    max       = NOLIMIT;
    stack_arg;
    descrip   = "Global assignments";
    doc =
    "The argument to each copy of this option will be inserted into\n"
    "the output definitions, with only a semicolon attached.";
};

flag = {
    name      = common_assign;
    flag_arg  = ":";
    arg_name  = ag-def;
    max       = NOLIMIT;
    stack_arg;
    descrip   = "Assignments common to all blocks";
    doc =
    "The argument to each copy of this option will be inserted into\n"
    "each output definition, with only a semicolon attached.";
};

flag = {
    name        = copy;
    flag_arg    = ":";
    arg_name    = file;
    max         = NOLIMIT;
    stack_arg;
    descrip     = "File(s) to copy into definitions";
    doc =
    "The content of each file named by these options will be inserted into\n"
    "the output definitions.";
};

flag = {
    name        = srcfile;
    flag_arg;     /* optional */
    arg_name    = file;
    descrip     = "Insert source file name into each def";
    doc =
    "Inserts the name of the input file where a definition was found\n"
    "into the output definition.\n"
    "If no argument is supplied, the format will be:\n"
    "@example\nsrcfile = '%s';\n@end example\n"
    "If an argument is supplied, that string will be used for the entry\n"
    "name instead of @var{srcfile}.";
};

flag = {
    name        = linenum;
    flag_arg;     /* optional */
    arg_name    = def-name;
    descrip     = "Insert source line number into each def";
    doc =
    "Inserts the line number in the input file where a definition\n"
    "was found into the output definition.\n"
    "If no argument is supplied, the format will be:\n"
    "@example\nlinenum = '%s';\n@end example\n"
    "If an argument is supplied, that string will be used for the entry\n"
    "name instead of @var{linenum}.";
};

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *  Definition Output Disposition Options:
 */
flag = {
    name        = doc_output;
    descrip     = "Definition output disposition options:";
    documentation;
};

flag = {
    name        = output;
    equivalence = "autogen";
    flag_arg    = ":";
    arg_name    = file;
    descrip     = "Output file to open";
    doc =
    "If you are not sending the output to an Augogen process,\n"
    "you may name an output file instead.";
};

flag = {
    name        = "autogen";
    equivalence = "autogen";
    flag_arg;     /* optional */
    arg_name    = ag-cmd;
    disable     = "no";
    enabled;
    descrip     = "Invoke AutoGen with defs";
    doc =
    "This is the default output mode.  Specifying @code{no-autogen} is\n"
    "equivalent to @code{output=-}.  If you supply an argument to this\n"
    "option, that program will be started as if it were AutoGen and\n"
    "its standard in will be set to the output definitions of this program.";
};

flag = {
    name        = template;
    flag_arg    = ":";
    arg_name    = file;
    descrip     = "Template Name";
    doc =
    "Specifies the template name to be used for generating the final output.";
};

flag = {
    name        = agarg;
    flag_arg    = ":";
    arg_name    = ag-opt;
    max         = NOLIMIT;
    stack_arg;
    descrip     = "AutoGen Argument";
    flags_cant  = output;
    doc =
    "This is a passthrough argument.  It allows you to have AutoGen invoked\n"
    "with any arbitrary argument.";
};

flag = {
    name        = base_name;
    flag_arg    = ":";
    arg_name    = name;
    descrip     = "Base name for output file(s)";
    flags_cant  = output;
    doc =
    "When output is going to AutoGen, a base name must either be supplied\n"
    "or derived.  If this option is not supplied, then it is taken from\n"
    "the @code{template} option.  If that is not provided either, then\n"
    "it is set to the base name of the current directory.";
};

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 *  Program Documentation
 */

detail =
"This program extracts AutoGen definitions from a list of source files.
Definitions are delimited by `/*=<entry-type> <entry-name>\\n' and `=*/\\n'.
From that, this program creates a definition of the following form:\n
    #line nnn \"source-file-name\"
    entry_type = {
        name = entry_name;
        ...
    };\n
The ellipsis '...' is filled in by text found between the two delimiters,
with everything up through the first sequence of asterisks deleted
on every line.";


/* * * * * MAN PAGE DESCRIPTION * * * * * * * * * * * * * * * * * * * */

prog_man_descrip =
"This program extracts \\fBAutoGen\\fP definitions from a list of source files.
Definitions are delimited by `/*=<entry-type> <entry-name>
\\\\n\\' and `=*/\\\\n\\'.  From that, this program creates
a definition of the following form:

    #line nnn \"source-file-name\"
    entry_type = {
        name = entry_name;
        ...
    };

The ellipsis `...' is filled in by text found between the two delimiters,
with everything up through the first sequence of asterisks deleted
on every line.  Additionally, if the `<entry-name>' is followed
by a comma, the word `if' and a name `if_name', then the above entry
will appear as:

@format
    #ifdef if_name
    #line nnn \"source-file-name\"
    entry_type = @{
        name = entry_name;
        ...
    @};
    #endif
@end format";

man_doc = '.SH "SEE ALSO"
This program is documented more fully in the Getdefs section
of the Add-On chapter in the
.IR AutoGen
Info system documentation.';


/* * * * * INFO DOC DESCRIPTION * * * * * * * * * * * * * * * * * * * */

prog_info_descrip =
"This program extracts AutoGen definitions from a list of source files.
Definitions are delimited by `/*=<entry-type> <entry-name>\\n\' and `=*/\\n\'.
From that, this program creates a definition of the following form:

@format
    #line nnn \"source-file-name\"
    entry_type = @{
        name = entry_name;
        ...
    @};
@end format

The ellipsis `...' is filled in by text found between the two delimiters,
with everything up through the first sequence of asterisks deleted
on every line.  Additionally, if the `<entry-name>' is followed
by a comma, the word `if' and a name `if_name', then the above entry
will appear as:

@format
    #ifdef if_name
    #line nnn \"source-file-name\"
    entry_type = @{
        name = entry_name;
        ...
    @};
    #endif
@end format";
