App-ShellCompleter-cpanm

 view release on metacpan or  search on metacpan

lib/App/ShellCompleter/cpanm.pm  view on Meta::CPAN

    App::lcpan::_set_args_default(\%lcpanargs);
    my $dbh = App::lcpan::_connect_db('ro', $lcpanargs{cpan}, $lcpanargs{index_name});
}

sub run_completer {
    my %cargs = @_;

    die "This script is for shell completion only\n"
        unless $ENV{GETOPT_LONG_DUMP} || $ENV{COMP_LINE} || $ENV{COMMAND_LINE};

    # the list of options is taken from Menlo::CLI:Compat. should be updated
    # from time to time.
    GetOptionsWithCompletion(
        sub {
            my %args  = @_;
            my $type      = $args{type};
            my $word      = $args{word};
            if ($type eq 'arg') {
                log_trace("[_cpanm] Completing arg");
                my $seen_opts = $args{seen_opts};
                if ($seen_opts->{'--uninstall'} || $seen_opts->{'--reinstall'}) {



( run in 0.354 second using v1.01-cache-2.11-cpan-05444aca049 )