App-ShellCompleter-cpanm
view release on metacpan or search on metacpan
lib/App/ShellCompleter/cpanm.pm view on Meta::CPAN
log_trace("[_cpanm] Trying completion: tarballs & dirs");
local $Complete::Common::OPT_FUZZY = 0;
local $Complete::Common::OPT_WORD_MODE = 0;
local $Complete::Common::OPT_CHAR_MODE = 0;
my $answer = complete_file(
filter => sub { log_trace(" $_"); /\.(zip|tar\.gz|tar\.bz2)$/i || (-d $_) },
word => $word,
);
}
# if that fails, and the word looks like the start of module name, try
# searching for CPAN module. currently we only query local CPAN for speed.
# if user already types something that looks like a path instead of module
# name, like '../' or perhaps 'C:\' (windows) then don't bother to complete
# with module name because it will just delay things without getting any
# result.
{
last unless $word eq '' || $word =~ /\A(\w+)(::\w+)*(::)?\z/;
use experimental 'smartmatch';
my $dbh = _connect_lcpan() or last;
my $sth;
( run in 0.449 second using v1.01-cache-2.11-cpan-64827b87656 )