CSAF::...Options(3pm)

πŸ“¦
version 0.26 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– CSAF::...Options β€” the manual page, but make it cute πŸ’–

okay bestie, so this is CSAF::Util::Options, and it lives in the User Contributed Perl Documentation section, subsection 3pm (that's Perl module docs, iykyk). no cap, it's shorter than you think but it's mighty. let's go πŸ¦‹


✨ NAME ✨

CSAF::Util::Options β€” the Options utility for CSAF. that's it, that's the whole name. iconic behaviour honestly πŸ‘‘


🌸 SYNOPSIS 🌸

here's the whole vibe, copy-paste energy, don't touch a character:

package My::CSAF::Options {

    use Moo;
    with 'CSAF::Util::Options';

    has enable_foo => (is => 'rw', required => 1);
    has make_bar => (is => 'rw');

}

package My::CSAF {

    use Moo;
    use My::CSAF::Options;

    has options => (is => 'lazy', build => 1);

    sub _build_options { My::CSAF::Options->new }

    sub my_job {

        my $self = shift;

        $self->options->configure(make_bar => $bar);

        if ($self->options->enable_foo) {
            [...]
        }
    }

}

see how you with 'CSAF::Util::Options' into your own package, declare your own has attributes, then from your main class you keep an options attribute (lazy, with a builder), build it with My::CSAF::Options->new, call configure(...) on it, and then read it back with $self->options->enable_foo? that's the whole loop, bestie, that's the plot πŸŽ€


πŸ’… DESCRIPTION πŸ’…

CSAF::Util::Options is a Moo role and utility for CSAF. so you're not subclassing some big heavy thing, you're wearing it. main character energy, but as a role πŸ’–

🌈 ATTRIBUTES 🌈

  • config_file β€” loads config from a YAML file. so your settings can come from YAML, not just from you typing them in. slay πŸ“

🌟 METHODS 🌟

  • configure β€” configures an item. here's how you call it:
$options->configure(
    foo => 'foo',
    bar => 'bar',
    baz => 'baz'
);

it's giving "just pass me key-value pairs and I'll handle it". lowkey the most useful thing here and it's like five lines. obsessed 😭


🫢 SUPPORT 🫢

πŸ› Bugs / Feature Requests

found a bug? got a feature request that's been living in your head rent free? please report them through the issue tracker at <https://github.com/giterlizzi/perl-CSAF/issues>. and the best part: you will be notified automatically of any progress on your issue. no refreshing, no "did they see it", the tracker just tells you. periodt ✨

πŸ“¦ Source Code

this is open source software, bestie. the code repository is out there for public review and contribution, under the terms of the license. go look, go contribute, go be part of it:

<https://github.com/giterlizzi/perl-CSAF>

git clone https://github.com/giterlizzi/perl-CSAF.git

that's the whole clone command, character for character, go get it 🧚


πŸ‘‘ AUTHOR πŸ‘‘

  • Giuseppe Di Terlizzi <gdt@cpan.org>

thank you for your service, king πŸ’œ


this software is copyright (c) 2023-2025 by Giuseppe Di Terlizzi.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like. go wild, but respectfully 🌈


and that's the page, bestie πŸ’– written against perl v5.40.1, dated 2025-09-03, served fresh from the User Contributed Perl Documentation section as CSAF::...Options(3pm). mwah, go configure something πŸŽ€βœ¨

πŸ“¦ where this page comes from