GRAYBYTE WORDPRESS FILE MANAGER5215

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /usr/local/share/perl5/CPAN/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /usr/local/share/perl5/CPAN//Complete.pm
# -*- 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: git log -p -1 355c44e9caaec857e4b12f51afb96498833c3e36 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.5001";

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;

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 05 2024 23:49:32
root / root
0755
API
--
March 03 2024 20:49:23
root / root
0755
Exception
--
March 03 2024 20:49:23
root / root
0755
FTP
--
March 03 2024 20:49:23
root / root
0755
HTTP
--
March 03 2024 20:49:23
root / root
0755
Kwalify
--
March 03 2024 20:49:23
root / root
0755
LWP
--
March 03 2024 20:49:23
root / root
0755
Meta
--
March 03 2024 20:49:25
root / root
0755
Plugin
--
March 03 2024 20:49:23
root / root
0755
Admin.pm
7.608 KB
November 27 2018 02:51:46
root / root
0444
Author.pm
6.682 KB
September 22 2018 19:39:13
root / root
0444
Bundle.pm
9.906 KB
May 19 2020 08:43:52
root / root
0444
CacheMgr.pm
7.484 KB
March 01 2020 16:07:13
root / root
0444
Complete.pm
5.882 KB
September 22 2018 19:39:13
root / root
0444
Debug.pm
2.053 KB
August 17 2016 05:38:12
root / root
0444
DeferredCode.pm
0.185 KB
September 08 2012 09:00:31
root / root
0444
Distribution.pm
178.964 KB
April 03 2022 19:00:28
root / root
0444
Distroprefs.pm
11.709 KB
March 01 2020 17:11:25
root / root
0444
Distrostatus.pm
0.949 KB
September 08 2012 09:00:31
root / root
0444
FTP.pm
48.679 KB
April 03 2022 18:19:14
root / root
0444
FirstTime.pm
73.021 KB
April 03 2022 18:19:14
root / root
0444
HandleConfig.pm
23.616 KB
April 03 2022 18:19:14
root / root
0444
Index.pm
21.715 KB
April 03 2022 18:19:14
root / root
0444
InfoObj.pm
6.747 KB
November 24 2013 14:12:21
root / root
0444
Kwalify.pm
3.348 KB
September 08 2012 09:00:31
root / root
0444
Mirrors.pm
17.822 KB
May 23 2020 17:14:15
root / root
0444
Module.pm
21.865 KB
September 22 2018 19:39:13
root / root
0444
Nox.pm
0.931 KB
August 17 2016 05:38:12
root / root
0444
Plugin.pm
3.144 KB
May 19 2020 08:43:52
root / root
0444
Prompt.pm
0.554 KB
September 08 2012 09:00:31
root / root
0444
Queue.pm
6.957 KB
May 19 2020 08:43:52
root / root
0444
Shell.pm
71.957 KB
May 23 2020 17:14:15
root / root
0444
Tarzip.pm
16.25 KB
May 19 2020 08:43:52
root / root
0444
URL.pm
0.574 KB
September 08 2012 09:00:31
root / root
0444
Version.pm
4.295 KB
September 22 2018 19:39:13
root / root
0444

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF