Getopt...stance(3pm)

πŸ“¦ version 2.000011, in ubuntu stonking

πŸ’– 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 a Getopt::Yath::State object, and that lil guy has the "settings", "skipped", "remains", "stop", "cleared", "modules", and "env" accessors. if you want the full list of parameters, go check Getopt::Yath, and for the returned object go check Getopt::Yath::State. 🧚
  • $option = $instance->add_option(%option_spec) β€” adds a brand new option to this instance. the %option_spec gets 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: $weight controls the ordering (lower runs first β€” remember that, it's the whole point), $applicable is an optional coderef filter, and $callback is 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. $format must 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, 2 for "=head2").
    • group => $group_name β€” only show options from the specified group.
    • settings => $settings β€” an Getopt::Yath::Settings object 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 and STDOUT is a terminal.
  • $map = $instance->option_map() $map = $instance->option_map(\@options) β€” returns a hashref mapping all option forms (like "--verbose", "-v", "--no-verbose") to their Getopt::Yath::Option objects. 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 of Getopt::Yath::Option objects 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 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