Getopt...Options(3pm)

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

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

okay bestie, so you know <pink>Getopt...Options(3pm)</pink>? yeah, that's this page. User Contributed Perl Documentation, that whole vibe. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

Getopt::Complete::Options β€” a command-line options specification. that's literally it, that's the whole name section, she's a simple queen πŸ‘‘


🌸 VERSION 🌸

This document describes Getopt::Complete 0.26. no, not 0.27, don't come for me, it's 0.26 periodt.


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the thing β€” this module is used internally by Getopt::Complete during compile. so like, backstage crew energy. main character energy but offscreen. πŸ’…

 my $opts = Getopt::Complete::Options->new(
    'myfile=s' => 'f',
    'mydir=s@'  => 'd',
    '<>' => ['one','two','three']
 );

now watch her do tricks ✨:

 $opts->option_names;
 # myfile mydir

 $opts->option_spec("mydir")
 # '=s@'

 $opts->option_handler("myfile")
 # 'f'

 $opts->option_handler("<>")
 # ['one','two','three'];

 $opts->handle_shell_completion;
 # if it detects it is talking to the shell completer, it will respond and then exit

 # this method is used by the above, then makes a Getopt::Complete::Args.
 ($text_typed,$option_name,$remainder_of_argv) = $self->parse_completion_request($comp_words,$comp_cword);

not me getting emotional over option_names returning myfile mydir 😭 so clean.


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie πŸ‘‘

Objects of this class are used to construct a Getop::Complete::Args from a list of command-line arguments. (yes, it's spelled Getop::Complete::Args up there in the original, i'm not touching it, don't look at me πŸ™ˆ). It specifies what options are available to the command line, helping to direct the parser. very much the "here's the menu, pick something" of the operation.

It also specifies what values are valid for those options, and provides an API for access by the shell to do tab-completion. so the shell can be like "hey what are my options" and this class is like "i gotchu 🫢".

The valid values list is also used by Getopt::Complete::Args to validate its option values, and produce the error list it generates. so it's giving both ✨ the good vibes ✨ and the receipts. accountability icon.


🌈 SEE ALSO 🌈

  • Getopt::Complete
  • Getopt::Complete::Args
  • Getopt::Complete;:Compgen

(yes, that last one literally has a semicolon in there. i am copying it character for character because that is my sacred duty. no cap. πŸ’€)


Copyright 2010 Scott Smith and Washington University School of Medicine. iconic. timeless. legally binding. ✨


πŸ’œ AUTHORS πŸ’œ

Scott Smith (sakoht at cpan .org). say hi, be normal about it. πŸ’Œ


πŸ“œ LICENSE πŸ“œ

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

bestie. read the LICENSE. it's right there in the module. it takes like two minutes and it's giving responsible queen. πŸŽ€

and that's the whole page fr fr πŸ’– go forth and spec your options, you absolute legend. this was perl v5.36.0, dated 2022-10-13, and yeah β€” <rainbow>Getopt...Options(3pm)</rainbow>. slay. πŸ’…βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from