Getopt...stance(3pm)
π Getopt::Yath::Instance β the manual page, but make it a group chat π
okay bestie, so this is the Getopt::Yath::Instance page from the User Contributed Perl Documentation (manual name: Getopt...stance(3pm) β yeah it's giving "my name got truncated by the terminal", iconic). Sit down, hydrate, and let's talk about an instance of options. π«Ά
β¨ NAME β¨
Getopt::Yath::Instance β an instance of options. that's it, that's the whole vibe. an instance. of options. π
πΈ DESCRIPTION πΈ
okay so here's the tea: this module does the real work for Getopt::Yath under the hood. it's the engine, the backstage crew, the little guy running around making everything happen while the star takes the bow. π
and because of that β it is probably better not to use this directly.
like. it's not for you bestie. no cap. π«£
π¦ SYNOPSIS π¦
Do not use this directly. The user interface you should be looking at is Getopt::Yath.
that's the entire synopsis. it's four words of "don't". the audacity. the confidence. we love a boundary-setting manpage. β¨
π METHODS π
get into it, here's every single one, no skipping, we don't do that here:
$state = $instance->process_args(\@argv, %params)β okay so this one parses the given argument list according to the defined options. what you get back is aGetopt::Yath::Stateobject, and that lil guy has the"settings","skipped","remains","stop","cleared","modules", and"env"accessors. if you want the full list of parameters, go checkGetopt::Yath, and for the returned object go checkGetopt::Yath::State. π§$option = $instance->add_option(%option_spec)β adds a brand new option to this instance. the%option_specgets passed directly to"create" in Getopt::Yath::Option. no middleman, no filtering, straight through. π«$instance->add_post_process($weight, $applicable, $callback)β registers a post-processing callback. so:$weightcontrols the ordering (lower runs first β remember that, it's the whole point),$applicableis an optional coderef filter, and$callbackis the coderef that actually runs after parsing. π―$instance->include($other_instance)$instance->include($other_instance, \@list)β merges options and post-processors from another instance into this one. and if you pass"\@list", then only options whose title, field, or name appears in that list get included. so it's a guest list, basically. bouncer energy. πͺ$text = $instance->docs($format, %params)β generates documentation for all applicable options.$formatmust be'cli'or'pod'. those are your only two, don't try anything else. the params can include:head => $levelβ the heading level for POD output (like,2for"=head2").group => $group_nameβ only show options from the specified group.settings => $settingsβ anGetopt::Yath::Settingsobject used to evaluate option applicability.applicable => $boolβ if true, include all options regardless of their applicability filter. yes, all of them. no filtering, full chaos. π₯color => $boolβ turns ANSI color on or off in CLI output. defaults to true if color is available andSTDOUTis a terminal.
$map = $instance->option_map()$map = $instance->option_map(\@options)β returns a hashref mapping all option forms (like"--verbose","-v","--no-verbose") to theirGetopt::Yath::Optionobjects. it also includes a"custom_match"key holding an arrayref of custom match coderefs. and heads up: results are cached unless you provide an explicit option list. π$groups = $instance->option_groups()β returns a hashref of the group names defined by the current options. results are cached. π$bool = $instance->have_group($name)β returns true if any option defines the given group name. simple. clean. does exactly one thing. we stan. β$instance->set_category_sort_map(%map)β sets the sort ordering for documentation categories. see"category_sort_map" in Getopt::Yath. π$options = $instance->options()β returns the arrayref ofGetopt::Yath::Optionobjects registered in this instance. the whole roster. the full squad. π
π SOURCE π
the source code repository for Getopt-Yath can be found at <http://github.com/Test-More/Getopt-Yath/>.
go look. go star it. go read the code. main character behavior. β
π«Ά 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/>
and that's the page bestie!! π perl v5.40.1, dated 2026-05-10, filed under Getopt...stance(3pm) β mwah, slay, go parse some args responsibly, drink water, and do not use this directly. periodt. π
β¨
π¦ 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