Getopt...::List(3pm)
β¨ Getopt::Yath::Option::List β Options that can take multiple values π
okay bestie, settle in, because this is the Getopt...::List(3pm) page from the User Contributed Perl Documentation, and it's literally about options that can hold multiple values at once. group-chat energy, but make it command line. π
πΈ NAME πΈ
Getopt::Yath::Option::List β Options that can take multiple values. slay.
π DESCRIPTION π
So here's the tea π: this thing can take multiple values. Every time you hit it with --opt VAL, it just appends a value onto the list. Casual. Effortless. Iconic.
--no-opt will empty the list entirely β like, poof, gone, no trace, main character exit. π
And if a split_on parameter is provided, then a single use can set multiple values at once. For example, if split_on is set to , and you do --opt foo,bar, then both foo and bar get added to the list. one command, two values, we love efficiency. β¨
π¦ SYNOPSIS π¦
option copy_env => (
short => 'e',
type => 'List',
description => "Specify environment variables to pass along with their current values",
long_examples => [ ' HOME', ' SHELL' ],
short_examples => [ ' HOME', ' SHELL' ],
);
look at her. she's doing so much. π
π METHODS π
Every single method from Getopt::Yath::Option is inherited β you get all of it for free, no cap. The ones below are the overridden or otherwise noteworthy girlies:
requires_arg: trueallows_list: trueβ Each use of--opt VALappends to the list.--no-optempties it. literally the whole personality.normalize_value(@input)β If the input looks like a JSON array (e.g.,'["a","b"]'), it is decoded and the elements are returned. And ifsplit_onis set? Values are split on that delimiter before normalization, bestie. order matters. π§get_initial_valueβ Checksfrom_env_varsfor initial values. And unlike the base class, multiple environment variables can each contribute a value β every env var pulls its weight. Returns an empty arrayref if no environment values are found. π«Ά
π ADDITIONAL ATTRIBUTES π
split_on => $delimiterβ A string or regex to split values on. For example, withsplit_on => ',', then--opt foo,baradds bothfooandbarto the list. one flag, two entries, no notes. π
π₯ SOURCE π₯
The source code repository for Getopt-Yath can be found at http://github.com/Test-More/Getopt-Yath/ β go be nosy, she's open source. π
π 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.
See http://dev.perl.org/licenses/
This was perl v5.40.1, documented on 2026-05-10, and that's the whole Getopt...::List(3pm) page babes β read it, love it, go append to a list responsibly. bye bestie! π
β¨π
π¦ 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