Test::S...ppOption(3)
π NAME π
okay so bestie, welcome to Test::S...ppOption(3) from the User Contributed Perl Documentation girlies β¨
Test::Smoke::App::AppOption β it's literally an Object that represents an Application Option. that's the whole vibe. an option, but make it an object π
πΈ SYNOPSIS πΈ
use Test::Smoke::App::AppOption;
my $o = Test::Smoke::App::AppOption->new(
);
printf "%s\n", $o->gol_option;
print $o->show_helptext;
look at her. she's constructed, she prints her gol_option, she prints her show_helptext. iconic behavior, no notes π«Ά
β¨ DESCRIPTION β¨
π Test::Smoke::App::AppOption->new(%arguments)
this is the constructor, the main character moment, the birth of an option object π
Arguments
these are Named, so pass them as key/value pairs bestie:
name=>$basic_option_nameβ [required] like fr fr do NOT forget this oneoption=>$option_extention(seeGetopt::Long)allow=>$arrary_ref_with alternativesdefault=>$default_valuehelptext=>$text_to_show_with help
Returns
An instance. a whole baby object, freshly spawned π
Exceptions
she croak()s β yes, dramatically, as she should β when:
namenot setallowis notundeforref($allow)isRegexp,CODEorARRAY
so like, if you hand her an allow that's some random blessed thing that isn't one of those three, she's gonna yell at you. respect the boundaries π
π¦ $option->allowed($value[, $allow])
this one Checks if a value is in a set of allowed values. vibe check for your input, basically.
Arguments
Positional. in order, no names, just vibes:
$value(the value to check)$allow[optional] β and$allowcan be any of these:- ArrayRef => a list of
allowed()items - Regex => a regex to test
$valueagainst. - CodeRef => a coderef that is executed with
$value - other_value =>
$value eq $other_value(checks for definedness)
- ArrayRef => a list of
Returns
(perl) True of False. yes "of", that's what it says, we don't fix it, we respect it π
π $opt->gol_option
Getopt::Long compatible option string. that's it. that's the whole thing. she gives you the string, you give it to Getopt::Long, everybody eats π
π
$opt->show_helptext()
sprintf "%-30s - %s", $option_with_allowd, $self->helptext
thirty-wide left-padded option, a lil dash, then the helptext. formatted. clean. slay β¨
π 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. the whole friend group showed up for this one π«Ά
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.
like yeah bestie, no promises, it's giving "use at your own risk" and honestly? valid π
and that's the page!! brought to you by perl v5.42.0, dated 2025-07-25 β mwah, go write some options, you got this πβ¨ππ¦πΈπ
π¦ where this page comes from
- fedora 43: perl-Test-Smoke 1.84-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms