Getopt...Options(3pm)
π 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::CompleteGetopt::Complete::ArgsGetopt::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 π
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
- ubuntu noble: libgetopt-complete-perl 0.26-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgetopt-complete-perl 0.26-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgetopt-complete-perl 0.26-4 Β· 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