Getopt...::Bool(3pm)
Getopt::Yath::Option::Bool π
okay bestie, gather round, because this is the manual page for Getopt::Yath::Option::Bool β it lives in the 3pm section (User Contributed Perl Documentation), and it is so much simpler than its cousins. it's giving "option type for boolean values (no arguments)". that's the whole personality. π
β¨ NAME β¨
Getopt::Yath::Option::Bool β it's the option type for boolean values (no arguments), periodt. π
πΈ DESCRIPTION πΈ
okay so picture this: a value that is either on or off. that's it, that's the vibe. π¦
--optβ turns it on β--no-optβ turns it off β
and the default? off. lowkey always off unless you hand it a default parameter. no cap. π―
β SYNOPSIS β
here's how you actually use it, bestie β look how cute:
option dry_run => (
type => 'Bool',
description => "Only pretend to do stuff",
default => 0,
);
iconic. a dry_run that only pretends to do stuff. main character energy fr fr. πβ¨
π§ METHODS π§
every single method from Getopt::Yath::Option is inherited, so you get all of that for free π«Ά. the ones below are either overridden or just noteworthy enough that we're calling them out.
requires_arg: falseβ nope, no argument required. it's a bool, it doesn't need your little inputs. πallows_arg: falseβ also no argument allowed, for the record. bool options take no argument.--optturns it on,--no-optturns it off. that's the whole deal. πcan_set_env: trueβ ohhh yes, bool options can set environment variables. and here's the spicy part: negated env vars (!VAR) are supported and they will invert the boolean value. so!VARis basically the "actually, no π" button. πget_default_valueβ returns0by default, unless you gave it a customdefault. simple as that. no notes. π
π₯ SOURCE π₯
the source code repository for Getopt-Yath can be found at http://github.com/Test-More/Getopt-Yath/ β go look, it's right there. π
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
π AUTHORS π
- Chad Granum
<exodist@cpan.org>
(yes bestie, same name in both lists, that's not a typo, that's just how it is π)
π 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/
friendly reminder: it's free software, go wild, but under the same terms as Perl itself, okay? π
and that's the whole page, bestie β perl v5.40.1, dated 2026-05-10. slay, you now officially understand bool options. go forth and toggle things. π β¨π
π¦ 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