MooseX...Dashes(3pm)

πŸ’… NAME πŸ’…

MooseX::Getopt::Dashes β€” bestie, it takes the underscores in your attribute names and turns them into dashes. That's the whole gig. Iconic, honestly.


✨ VERSION ✨

version 0.78 β€” that's the one you're getting, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

okay so picture this:

package My::App;
use Moose;
with 'MooseX::Getopt::Dashes';

# Will be called as --some-thingy, not --some_thingy
has 'some_thingy' => (
    is      => 'ro',
    isa     => 'Str',
    default => 'foo'
);

# Will be called as --another_thingy, not --another-thingy
has 'another_thingy' => (
    traits   => [ 'Getopt' ],
    cmd_flag => 'another_thingy'
    is       => 'ro',
    isa      => 'Str',
    default  => 'foo'
);

# use as MooseX::Getopt

see how the first one gets a glow-up (underscore β†’ dash) and the second one stays exactly as it is because we told it to? yeah. that's the vibe. πŸ¦‹


🌸 DESCRIPTION 🌸

So MooseX::Getopt::Dashes is literally just a version of MooseX::Getopt that, when it's generating your command line flags, converts the underscores in your attribute names into dashes. that's it. that's the personality. ✨

and the way that you can selectively disable this?? on a per-attribute basis, bestie. just hand it a cmd_flag argument with the command flag you want for that specific attribute, and boom β€” no underscore-to-dash replacement will be done on the cmd_flag. it leaves it alone. respects its choices. 🫢


πŸ’œ SUPPORT πŸ’œ

got bugs? we don't gatekeep. submit them through the RT bug tracker at <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Getopt> (or <mailto:bug-MooseX-Getopt@rt.cpan.org> β€” same energy, different door πŸ’Œ).

there's also a mailing list for users of this distribution, lowkey a whole community, at <http://lists.perl.org/list/moose.html>.

and there's an irc channel too, for when you wanna talk to actual humans about this, at #moose on irc.perl.org β€” link right here: <irc://irc.perl.org/#moose> 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Stevan Little <stevan@iinteractive.com> β€” the main character who made this happen. periodt.


This software is copyright (c) 2007 by Infinity Interactive, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay. πŸ’–


okay that's the whole page bestie, go forth and flag responsibly πŸŽ€

this has been MooseX...Dashes(3pm) from the User Contributed Perl Documentation collection, running on perl v5.40.0, dated 2025-01-11 β€” ily, bye πŸ’…πŸ’–

πŸ“¦ where this page comes from