The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Smoke::App::AppOption - Object that represents an Application Option.

SYNOPSIS

    use Test::Smoke::App::AppOption;
    my $o = Test::Smoke::App::AppOption->new(
    );
    printf "%s\n", $o->gol_option;
    print $o->show_helptext;

DESCRIPTION

Test::Smoke::App::AppOption->new(%arguments)

Arguments

Named:

name => $basic_option_name [required]
option => $option_extention (see Getopt::Long)
allow => $arrary_ref_with alternatives
default => $default_value
helptext => $text_to_show_with help

Returns

An instance.

Exceptions

croak()s when:

name not set
allow is not undef or ref($allow) is Regexp, CODE or ARRAY

$option->allowed($value[, $allow])

Checks if a value is in a set of allowed values.

Arguments

Positional.

$value (the value to check)
$allow [optional]

$allow can be:

  • ArrayRef => a list of allowed() items

  • Regex => a regex to test $value against.

  • CodeRef => a coderef that is executed with $value

  • other_value => $value eq $other_value (checks for definedness)

Returns

(perl) True of False.

$opt->gol_option

Getopt::Long compatible option string.

$opt->show_helptext()

    sprintf "%-30s - %s", $option_with_allowd, $self->helptext

COPYRIGHT

(c) 2002-2013, Abe Timmerman <abeltje@cpan.org> All rights reserved.

With contributions from Jarkko Hietaniemi, Merijn Brand, Campo Weijerman, Alan Burlison, Allen Smith, Alain Barbet, Dominic Dunlop, Rich Rauenzahn, David Cantrell.

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

See:

This program 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.