Actions Status MetaCPAN Release

NAME

Getopt::EX::Hashed - Hash store object automation for Getopt::Long

VERSION

Version 1.03

SYNOPSIS

use App::foo;
App::foo->new->run();

package App::foo;

use Getopt::EX::Hashed; {
    has start    => ' =i  s begin ' , default => 1;
    has end      => ' =i  e       ' ;
    has file     => ' =s@ f       ' , is => 'rw', any => qr/^(?!\.)/;
    has score    => ' =i          ' , min => 0, max => 100;
    has answer   => ' =i          ' , must => sub { $_[1] == 42 };
    has mouse    => ' =s          ' , any => [ 'Frankie', 'Benjy' ];
    has question => ' =s          ' , any => qr/^(life|universe|everything)$/i;
} no Getopt::EX::Hashed;

sub run {
    my $app = shift;
    use Getopt::Long;
    $app->getopt or pod2usage();
    if ($app->{start}) {
        ...

DESCRIPTION

Getopt::EX::Hashed is a module to automate a hash object to store command line option values for Getopt::Long and compatible modules including Getopt::EX::Long.

Major objective of this module is integrating initialization and specification into single place.

Module name shares Getopt::EX, but it works independently from other modules in Getopt::EX, so far.

Accessor methods are automatically generated when appropriate parameter is given.

FUNCTION

METHOD

SEE ALSO

Getopt::Long

Getopt::EX, Getopt::EX::Long

AUTHOR

Kazumasa Utashiro

COPYRIGHT

The following copyright notice applies to all the files provided in this distribution, including binary files, unless explicitly noted otherwise.

Copyright 2021 Kazumasa Utashiro

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.