[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.129.211.156: ~ $
# -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*-
# vim: ts=4 sts=4 sw=4:
package CPAN::Complete;
use strict;
@CPAN::Complete::ISA = qw(CPAN::Debug);
# Q: where is the "How do I add a new command" HOWTO?
# A: svn diff -r 1048:1049 where andk added the report command
@CPAN::Complete::COMMANDS = sort qw(
                                    ? ! a b d h i m o q r u
                                    autobundle
                                    bye
                                    clean
                                    cvs_import
                                    dump
                                    exit
                                    failed
                                    force
                                    fforce
                                    hosts
                                    install
                                    install_tested
                                    is_tested
                                    look
                                    ls
                                    make
                                    mkmyconfig
                                    notest
                                    perldoc
                                    quit
                                    readme
                                    recent
                                    recompile
                                    reload
                                    report
                                    reports
                                    scripts
                                    smoke
                                    test
                                    upgrade
);

use vars qw(
            $VERSION
);
$VERSION = "5.5";

package CPAN::Complete;
use strict;

sub gnu_cpl {
    my($text, $line, $start, $end) = @_;
    my(@perlret) = cpl($text, $line, $start);
    # find longest common match. Can anybody show me how to peruse
    # T::R::Gnu to have this done automatically? Seems expensive.
    return () unless @perlret;
    my($newtext) = $text;
    for (my $i = length($text)+1;;$i++) {
        last unless length($perlret[0]) && length($perlret[0]) >= $i;
        my $try = substr($perlret[0],0,$i);
        my @tries = grep {substr($_,0,$i) eq $try} @perlret;
        # warn "try[$try]tries[@tries]";
        if (@tries == @perlret) {
            $newtext = $try;
        } else {
            last;
        }
    }
    ($newtext,@perlret);
}

#-> sub CPAN::Complete::cpl ;
sub cpl {
    my($word,$line,$pos) = @_;
    $word ||= "";
    $line ||= "";
    $pos ||= 0;
    CPAN->debug("word [$word] line[$line] pos[$pos]") if $CPAN::DEBUG;
    $line =~ s/^\s*//;
    if ($line =~ s/^((?:notest|f?force)\s*)//) {
        $pos -= length($1);
    }
    my @return;
    if ($pos == 0 || $line =~ /^(?:h(?:elp)?|\?)\s/) {
        @return = grep /^\Q$word\E/, @CPAN::Complete::COMMANDS;
    } elsif ( $line !~ /^[\!abcdghimorutl]/ ) {
        @return = ();
    } elsif ($line =~ /^a\s/) {
        @return = cplx('CPAN::Author',uc($word));
    } elsif ($line =~ /^ls\s/) {
        my($author,$rest) = $word =~ m|([^/]+)/?(.*)|;
        @return = $rest ? () : map {"$_/"} cplx('CPAN::Author',uc($author||""));
        if (0 && 1==@return) { # XXX too slow and even wrong when there is a * already
            @return = grep /^\Q$word\E/, map {"$author/$_->[2]"} CPAN::Shell->expand("Author",$author)->ls("$rest*","2");
        }
    } elsif ($line =~ /^b\s/) {
        CPAN::Shell->local_bundles;
        @return = cplx('CPAN::Bundle',$word);
    } elsif ($line =~ /^d\s/) {
        @return = cplx('CPAN::Distribution',$word);
    } elsif ($line =~ m/^(
                          [mru]|make|clean|dump|get|test|install|readme|look|cvs_import|perldoc|recent
                         )\s/x ) {
        if ($word =~ /^Bundle::/) {
            CPAN::Shell->local_bundles;
        }
        @return = (cplx('CPAN::Module',$word),cplx('CPAN::Bundle',$word));
    } elsif ($line =~ /^i\s/) {
        @return = cpl_any($word);
    } elsif ($line =~ /^reload\s/) {
        @return = cpl_reload($word,$line,$pos);
    } elsif ($line =~ /^o\s/) {
        @return = cpl_option($word,$line,$pos);
    } elsif ($line =~ m/^\S+\s/ ) {
        # fallback for future commands and what we have forgotten above
        @return = (cplx('CPAN::Module',$word),cplx('CPAN::Bundle',$word));
    } else {
        @return = ();
    }
    return @return;
}

#-> sub CPAN::Complete::cplx ;
sub cplx {
    my($class, $word) = @_;
    if (CPAN::_sqlite_running()) {
        $CPAN::SQLite->search($class, "^\Q$word\E");
    }
    my $method = "id";
    $method = "pretty_id" if $class eq "CPAN::Distribution";
    sort grep /^\Q$word\E/, map { $_->$method() } $CPAN::META->all_objects($class);
}

#-> sub CPAN::Complete::cpl_any ;
sub cpl_any {
    my($word) = shift;
    return (
            cplx('CPAN::Author',$word),
            cplx('CPAN::Bundle',$word),
            cplx('CPAN::Distribution',$word),
            cplx('CPAN::Module',$word),
           );
}

#-> sub CPAN::Complete::cpl_reload ;
sub cpl_reload {
    my($word,$line,$pos) = @_;
    $word ||= "";
    my(@words) = split " ", $line;
    CPAN->debug("word[$word] line[$line] pos[$pos]") if $CPAN::DEBUG;
    my(@ok) = qw(cpan index);
    return @ok if @words == 1;
    return grep /^\Q$word\E/, @ok if @words == 2 && $word;
}

#-> sub CPAN::Complete::cpl_option ;
sub cpl_option {
    my($word,$line,$pos) = @_;
    $word ||= "";
    my(@words) = split " ", $line;
    CPAN->debug("word[$word] line[$line] pos[$pos]") if $CPAN::DEBUG;
    my(@ok) = qw(conf debug);
    return @ok if @words == 1;
    return grep /^\Q$word\E/, @ok if @words == 2 && length($word);
    if (0) {
    } elsif ($words[1] eq 'index') {
        return ();
    } elsif ($words[1] eq 'conf') {
        return CPAN::HandleConfig::cpl(@_);
    } elsif ($words[1] eq 'debug') {
        return sort grep /^\Q$word\E/i,
            sort keys %CPAN::DEBUG, 'all';
    }
}

1;

Filemanager

Name Type Size Permission Actions
API Folder 0755
Exception Folder 0755
FTP Folder 0755
HTTP Folder 0755
Kwalify Folder 0755
LWP Folder 0755
Plugin Folder 0755
Admin.pm File 7.61 KB 0444
Author.pm File 6.68 KB 0644
Bundle.pm File 9.03 KB 0644
CacheMgr.pm File 7.48 KB 0644
Complete.pm File 5.85 KB 0644
Config.pm File 9.81 KB 0644
Config.pm.1495584755 File 10.08 KB 0644
Config.pm.1496275908 File 10.08 KB 0644
Config.pm.1498608719 File 10.07 KB 0644
Config.pm.1499904706 File 10.04 KB 0644
Config.pm.1499991045 File 10.08 KB 0644
Config.pm.1500077464 File 10.08 KB 0644
Config.pm.1500336657 File 10.08 KB 0644
Config.pm.1501200686 File 10.08 KB 0644
Config.pm.1504224690 File 10.08 KB 0644
Config.pm.1505261476 File 9.97 KB 0644
Config.pm.1505779932 File 9.93 KB 0644
Config.pm.1506557632 File 9.93 KB 0644
Config.pm.1507767121 File 9.84 KB 0644
Config.pm.1508285482 File 9.87 KB 0644
Config.pm.1508803898 File 9.87 KB 0644
Config.pm.1509495108 File 9.81 KB 0644
Config.pm.1510272683 File 9.77 KB 0644
Config.pm.1510963855 File 9.86 KB 0644
Config.pm.1511223072 File 9.85 KB 0644
Config.pm.1513037604 File 9.86 KB 0644
Config.pm.1513642246 File 9.9 KB 0644
Config.pm.1513901506 File 9.9 KB 0644
Config.pm.1515456673 File 9.9 KB 0644
Config.pm.1516061466 File 9.86 KB 0644
Config.pm.1516234390 File 9.86 KB 0644
Config.pm.1516666262 File 9.82 KB 0644
Config.pm.1517443921 File 9.82 KB 0644
Config.pm.1519344677 File 9.82 KB 0644
Config.pm.1520986232 File 9.82 KB 0644
Config.pm.1521504678 File 9.84 KB 0644
Config.pm.1522714247 File 9.31 KB 0644
Config.pm.1524096686 File 9.78 KB 0644
Config.pm.1525738266 File 9.87 KB 0644
Config.pm.1526947858 File 9.87 KB 0644
Debug.pm File 2.05 KB 0644
DeferredCode.pm File 189 B 0644
Distribution.pm File 145.09 KB 0644
Distroprefs.pm File 10.84 KB 0644
Distrostatus.pm File 972 B 0644
FTP.pm File 41.19 KB 0644
FirstTime.pm File 66.98 KB 0644
HandleConfig.pm File 22.61 KB 0644
Index.pm File 21.43 KB 0644
InfoObj.pm File 6.75 KB 0644
Kwalify.pm File 3.35 KB 0644
Mirrors.pm File 14.55 KB 0644
Module.pm File 21.52 KB 0644
Nox.pm File 928 B 0644
Plugin.pm File 3.14 KB 0444
Prompt.pm File 567 B 0644
Queue.pm File 6.31 KB 0644
Shell.pm File 68.45 KB 0644
Tarzip.pm File 15.69 KB 0644
URL.pm File 588 B 0644
Version.pm File 4.21 KB 0644