App-Codeowners

 view release on metacpan or  search on metacpan

lib/App/Codeowners/Options.pm  view on Meta::CPAN


    $options = App::Codeowners::Options->new(@ARGV);

Construct a new object.

=head2 command

    $str = $options->command;

Get the command specified by args provided when the object was created.

=head2 args

    $args = $options->args;

Get the args provided when the object was created.

=head2 get_options

    $options = $options->get_options(
        args     => \@ARGV,
        spec     => \@expected_options,
        callback => sub { my ($arg, $results) = @_; ... },
    );

Convert command-line arguments to options, based on specified rules.

Returns a hashref of options or C<undef> if an error occurred.

=over 4

=item *

C<args> - Arguments from the caller (e.g. C<@ARGV>).

=item *

C<spec> - List of L<Getopt::Long> compatible option strings.

=item *

C<callback> - Optional coderef to call for non-option arguments.

=item *

C<config> - Optional L<Getopt::Long> configuration string.

=back

=head2 shell_completion

    $options->shell_completion($shell_type);

Print shell code to C<STDOUT> for the given type of shell. When eval'd, the shell code enables
completion for the F<git-codeowners> command.

=head2 completions

    $options->completions($current_arg_index, @args);

Print completions to C<STDOUT> for the given argument list and cursor position, and exit.

May also exit with status 9 and a compgen action printed to C<STDOUT> to indicate that the shell
should generate its own completions.

Doesn't return.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website
L<https://github.com/chazmcgarvey/git-codeowners/issues>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=head1 AUTHOR

Charles McGarvey <chazmcgarvey@brokenzipper.com>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Charles McGarvey.

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

=cut



( run in 1.173 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )