logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Getopt::Complete::Options - a command-line options specification

Authors

       Scott Smith (sakoht at cpan .org)

Description

       Objects of this class are used to construct a Getop::Complete::Args from a list of command-line
       arguments.  It specifies what options are available to the command line, helping to direct the parser.

       It also specifies what values are valid for those options, and provides an API for access by the shell to
       do tab-completion.

       The valid values list is also used by Getopt::Complete::Args to validate its option values, and produce
       the error list it generates.

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.

perl v5.36.0                                       2022-10-13                     Getopt::Complete::Options(3pm)

Name

       Getopt::Complete::Options - a command-line options specification

See Also

       Getopt::Complete, Getopt::Complete::Args, Getopt::Complete;:Compgen

Synopsis

       This is used internally by Getopt::Complete during compile.

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

        $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);

Version

       This document describes Getopt::Complete 0.26

See Also