Getopt::Yath::Option::List(3)

NAME
Getopt::Yath::Option::List - Options that can take multiple values.

DESCRIPTION
Can take multiple values. "--opt VAL" appends a value to the list. "--no-opt" will empty the list. If a "split_on" parameter is provided then a single use can set multiple values. For example if "split_on" is set to "," then "--opt foo,bar" is provided, then "foo" and "bar" will both be added to the list.

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' ],
    );

METHODS
All methods from Getopt::Yath::Option are inherited. The following are overridden or noteworthy:

requires_arg: true
allows_list: true
    Each use of "--opt VAL" appends to the list. "--no-opt" empties it.

normalize_value(@input)
    If the input looks like a JSON array (e.g., '["a","b"]'), it is decoded and the elements are returned. If "split_on" is set, values are split on that delimiter before normalization.

get_initial_value
    Checks "from_env_vars" for initial values. Unlike the base class, multiple environment variables can each contribute a value. 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, with "split_on => ','", "--opt foo,bar" adds both "foo" and "bar" to the list.

SOURCE
The source code repository for Getopt-Yath can be found at <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.

See <http://dev.perl.org/licenses/>