symkat > Config-Layered > Config::Layered::Source::Getopt

Download:
Config-Layered-0.000003.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Config::Layered::Source::Getopt - The Command Line Source

DESCRIPTION ^

The Getopt source provides access to Getopt::Long and will configure it based on the default data structure.

The configuration of the Getopt::Long options is done in the following way:

EXAMPLE ^

    my $config = Config::Layered->load_config( 
        sources => [ 'ConfigAny' => { file => "/etc/myapp" } ],
        default => {
            foo         => "bar",
            blee        => 1,
            size        => 20,
            bax         => { chicken => "eggs", }
            baz         => [ wq( foo bar blee ) ]
        }
    );

The above data structure would create the following Getopt::Long configuration:

    Getopts( \%config,
        "foo=s",
        "blee!",
        "size",
        "bax%",
        "baz@",
    );

SOURCE ARGUMENTS ^

syntax highlighting: