Getopt...AutoMap(3pm)
π NAME π
Getopt::Yath::Option::AutoMap β it's the option type that takes all the values you throw at it, but also has a lil default ready to go if you show up with nothing. Bestie, it's giving "I can do both" energy. π«Ά
πΈ DESCRIPTION πΈ
Okay so picture this: this bad boy is a mashup of the 'Auto' type and the 'Map' type. The no-arg form --opt will add the default key+value pairs straight into the hash β no input needed, it just knows. β¨
Then the --opt=KEY=VAL form comes through and adds additional values on top.
So basically: silence gets you the defaults, and speaking up gets you defaults plus your stuff. Iconic behavior tbh. π
π SYNOPSIS π
option env_var => (
field => 'env_vars',
short => 'E',
type => 'Map',
long_examples => [' VAR=VAL'],
short_examples => ['VAR=VAL', ' VAR=VAL'],
description => 'Set environment variables',
autofill => sub { +{ HOME => $ENV{HOME}, USER => $ENV{USER} } },
);
π¦ METHODS π¦
Every single method from Getopt::Yath::Option::Map is inherited, no cap. These ones below are either overridden or just lowkey worth calling out:
requires_arg: falseβ nope, you do not have to hand it an argument. It's fine on its own. πallows_autofill: trueβ yes queen, autofill is permitted.requires_autofill: trueβ and actually it's not just permitted, it's required bestie.
And here's the tea β on how those play out:
--optadds the autofill key/value pairs. All by itself. So brave. π₯Ή--opt=KEY=VALadds a specific pair instead.
π SOURCE π
The source code repository for Getopt-Yath lives right here, come thru:
<http://github.com/Test-More/Getopt-Yath/>
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
β AUTHORS β
- Chad Granum
<exodist@cpan.org>
π§ COPYRIGHT π§
Copyright Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Periodt.
See <http://dev.perl.org/licenses/>
okay that's the whole page bestie, you ate that π β¨
That's a wrap on Getopt...AutoMap(3pm) from perl v5.40.1, dated 2026-05-10 β see you in the next manpage, mwah π«Άπ
π¦ where this page comes from
- ubuntu stonking: libgetopt-yath-perl 2.000011-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms