Config-Maker
view release on metacpan or search on metacpan
configit [OPTIONS] <metacofnig...>
Options:
-h, --help Display this help message.
-m, --man Display manual page.
-n, --dry-run Don't install the built files.
-f, --force Install all output, even if equal to cache.
-v, --verbose Print more progress info.
-q, --quiet Don't print any progress info.
-D, --debug Print debugging infromation.
-T, --trace Trace the parsers.
=head1 DESCRIPTION
This program generates files from a metaconfig, configuration and templates.
The metaconfiguration file contains two important pieces of information
E<ndash> the schema, which says how the config should be parsed and the
description of config files and templates to process.
The config file contains data in a simple hierarchical form.
The templates are text interleaved with special directives. These directives
can select items (directives) from the config and insert their contents. It is
possible to check whether directives are present and iterate over them. And
when that's too weak, it allows insering snippets of Perl code.
=head1 Configuration
=head2 Overall syntax
The configuration file (both metaconfig and configuration) have the same
syntax. Each config file is composed of directives. Simple directives are
optionaly followed by a value and a semicolon (C<;>). Group directives are
optionaly followed by a value and then a block in curly braces is given, that
can contain further directives. Each directive specifies how the value should
look and what directives are allowed in it's block.
A directive or a block can be replaced by filename in angle brackets
(C<E<lt>E<gt>>). Contents of that file will be inserted in that place, or used
as content of the block respectively. The file must be a valid config file on
it's own (ie. all the directives must be closed).
Comments start with a C<#> and extend to the end of line. They are
syntacticaly equivalent to a whitespace.
The directives take several types of values:
=over 4
=item void
This is used to refer to non-value. No value may be specified.
=item identifier
Starts with a letter and continues with alphanumerics, dashes and underscores.
Unicode letters are recognized and valid.
In perl 5.8 and later, the program internaly operates in unicode. It assumes
all input files are in encoding specified by C<LC_CTYPE> locale variable, but
if they contain a comment near beginning or end (first/last 250 bytes) with
C<encoding:> or C<fenc=> followed by encoding name, they are assumed to be in
that encoding. In perl 5.6 (and 5.7) recoding is not available and the program
will warn if it encounters encoding specifications.
(Note: The prefix regex is really C<(((file)en)coding|fenc)[[:=]\s*>)
=item string
A string can be either a bareword (of alphanumerics and some common non-special
characters), or a single or double-quoted string. In double-quoted string,
common C<\> escape sequences and environment variables are expanded.
=item dns name
ASCII alphanumerics and dashes.
=item dns zone
DNS names separated with dots.
=item ipv4
Doted decimal IPv4 address. Only 4-byte notation is supported.
=item port
Number from 0 to 65535.
=item ipv4_port
I<ipv4>C<:>I<port>
=item ipv4_mask
I<ipv4> followed by a slash and a number from 0 to 32.
=item mac
Six pairs of hex digits separated by colons.
=item path
Path, such as used in templates to select config elements. See below.
=item pair
Two values of types given, separated by whitespace.
=item list
Any number of values of types given, separated by whitespace.
=item nested_list
A list enclosed in square brackets (C<[]>), that can contain values of type
specified or sublists (again in square brackets).
=item perlcode
( run in 2.449 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )