NAME
Getopt::Yath::Settings::Group - Representation of an option group.
DESCRIPTION
This is used by Getopt::Yath::Settings to represent parsed group settings.
SYNOPSIS
my $parsed = parse_options(\@ARGV, ...);
my $settings = $parsed->settings;
my $value = $settings->GROUP->OPTION;
# Or
my $value = $settings->group('GROUP')->option('OPTION');
# Or
my $value = $settings->maybe('GROUP' => 'OPTION', $default);
if ($group = $settings->check_group('GROUP')) {
# We have the specified group
}
METHODS
- %options = $group->all
-
Get all options, key/value pairs.
- $bool = $group->check_option($option_name)
-
Check if an option exists.
- $value = $group->option($option_name)
- $value = $group->option($option_name, $value)
- $group->option($option_name) = $value
-
Get/set an option.
- $group->create_option($option_name, $value)
-
Create the specified option.
- $ref = $group->option_ref($option_name)
- $ref = $group->option_ref($option_name, $create)
-
Get a reference to the value of the specified option. Optionally create it if it does not exist.
my $ref = $group->option_ref('foo'); $$ref = 'I am setting the option value'; - $value = $group->delete_option($option_name)
- $value = $group->remove_option($option_name)
-
Delete an option, returning the value it used to have.
SOURCE
The source code repository for Getopt-Yath can be found at http://github.com/Test-More/Getopt-Yath/.
MAINTAINERS
AUTHORS
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.