Getopt:...::Usage(3)

πŸ’– Getopt:...::Usage(3) β€” the manual page, but make it make sense πŸ’–

okay bestie, you found Getopt:...::Usage(3), the user-contributed Perl doc for Getopt::Long::Descriptive::Usage, aka the usage description for GLD. it's giving utility, it's giving behind-the-scenes, and honestly? it's shorter than you think. let's go 🫢


✨ NAME ✨

Getopt::Long::Descriptive::Usage β€” the usage description for GLD πŸ’…


πŸŽ€ VERSION πŸŽ€

version 0.117 β€” that's the vibe, that's the number, no cap.


🌸 SYNOPSIS 🌸

use Getopt::Long::Descriptive;
my ($opt, $usage) = describe_options( ... );

$usage->text; # complete usage message

$usage->die;  # die with usage message

like, that's the whole flex. you get an $opt and a $usage back, and then $usage is your girl for printing or yeeting out an error. πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk: this document only describes the methods of the Usage object. that's it. that's the scope. if you want to know how to actually use Getopt::Long::Descriptive, you gotta go read its documentation instead, because this page is not that page. πŸŽ€


⭐ PERL VERSION ⭐

this library should run on perls released even a long time ago, bestie. like, it should work on any version of perl released in the last five years. lowkey iconic for a piece of software to be that chill. 🌈

but listen β€” although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so don't come for her with a downgrade PR, she's not doing that. πŸ’€

πŸ‘‘ METHODS πŸ‘‘

πŸ’œ new

my $usage = Getopt::Long::Descriptive::Usage->new(\%arg);

ngl you really don't need to call this. GLD will do it for you. let the framework handle it, she's got it. 🫢

valid arguments are:

  • options β€” an arrayref of options
  • leader_text β€” the text that leads the usage; this may go away! πŸ‘€

πŸ“ text

this returns the full text of the usage message. the whole thing. the complete package. ✨

🧚 leader_text

this returns the text that comes at the beginning of the usage message. the intro, the opener, the little preamble moment. πŸŽ€

πŸ’… option_text

this returns the text describing the available options. all the flags, all the goodness. 🌟

😭 warn

this warns with the usage message. just a warning, she's not mad, she's just disappointed. πŸ™ˆ

πŸ’€ die

this throws the usage message as an exception. dramatic? yes. effective? also yes.

$usage_obj->die(\%arg);

some arguments can be provided:

  • pre_text β€” text to be prepended to the usage message
  • post_text β€” text to be appended to the usage message
⚠️ the pre_text and post_text arguments are concatenated with the usage message with no line breaks, so supply this if you need them. like, if you need newlines, you have to bring them yourself. no free formatting here. 🫠

🫢 AUTHORS 🫢

  • Hans Dieter Pearcey <hdp@cpan.org>
  • Ricardo Signes <cpan@semiotic.systems>

two icons, one module. periodt. πŸ‘‘


this software is copyright (c) 2005 by Hans Dieter Pearcey.

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, honestly. open source royalty fr fr. πŸ’–


okay that's the whole page, bestie!! this was Getopt:...::Usage(3) β€” and per the footer, it's from perl v5.42.0, dated 2026-02-20, so if you're reading this from the future, hi, hope perl is thriving 🌸✨ mwah, go describe some options πŸ’…

πŸ“¦ where this page comes from