App-wordlist

 view release on metacpan or  search on metacpan

script/_wordlist  view on Meta::CPAN



            # calculate the line number of data section
            my $data_pos = tell(DATA);
            seek DATA, 0, 0;
            my $pos = 0;
            while (1) {
                my $line = <DATA>;
                $pos += length($line);
                $data_linepos++;
                last if $pos >= $data_pos;
            }
            seek DATA, $data_pos, 0;

            \%toc;
        };
        if ($toc->{$_[1]}) {
            warn "[datapacker] $_[1] FOUND in packed modules\n" if $debug;
            seek DATA, $toc->{$_[1]}[0], 0;
            read DATA, my($content), $toc->{$_[1]}[1];
            my ($order, $lineoffset) = split(';', $toc->{$_[1]}[2]);
            $content =~ s/^#//gm;
            $content = "# line ".($data_linepos + $order+1 + $lineoffset)." \"".__FILE__."\"\n" . $content;
            open my $fh, '<', \$content
                or die "DataPacker error loading $_[1]: $!";
            return $fh;
        } else {
            warn "[datapacker] $_[1] NOT found in packed modules\n" if $debug;
        }
        return;
    }; # handler
    unshift @INC, bless(sub {"dummy"}, "main::_DataPacker");
}
# END DATAPACK CODE


# Note: This completer script is generated by App::GenPericmdCompleterScript version 0.126
# on Fri Mar  7 15:57:21 2025. You probably should not manually edit this file.

# NO_PERINCI_CMDLINE_SCRIPT
# PERINCI_CMDLINE_COMPLETER_SCRIPT: {load_module=>["App::wordlist"],program_name=>"wordlist",read_config=>0,read_env=>0,skip_format=>undef,subcommands=>undef,url=>"/App/wordlist/wordlist"}
# FRAGMENT id=shcompgen-hint completer=1 for=wordlist
# PODNAME: _wordlist
# ABSTRACT: Completer script for wordlist

use 5.010;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2025-03-07'; # DATE
our $DIST = 'App-wordlist'; # DIST
our $VERSION = '0.295'; # VERSION
die "Please run this script under shell completion\n" unless $ENV{COMP_LINE} || $ENV{COMMAND_LINE};

# require extra modules
use App::wordlist ();

my $args = {load_module=>["App::wordlist"],program_name=>"wordlist",read_config=>0,read_env=>0,skip_format=>undef,subcommands=>undef,url=>"/App/wordlist/wordlist"};

my $meta = {_orig_args_as=>undef,_orig_result_naked=>undef,args=>{action=>{cmdline_aliases=>{L=>{code=>sub{package App::wordlist;use warnings;use strict;no feature;use feature ':5.10';my $args = shift();$$args{'action'} = 'list_cpan'},is_flag=>1,summ...

my $sc_metas = {};

my $copts = {format=>{default=>undef,description=>"\nOutput can be displayed in multiple formats, and a suitable default format is\nchosen depending on the application and/or whether output destination is\ninteractive terminal (i.e. whether output is...

my $r = {common_opts=>$copts};

# get words
my $shell;
my ($words, $cword);
if ($ENV{COMP_LINE}) { $shell = "bash"; require Complete::Bash; require Encode; ($words,$cword) = @{ Complete::Bash::parse_cmdline() }; ($words,$cword) = @{ Complete::Bash::join_wordbreak_words($words,$cword) }; $words = [map {Encode::decode("UTF-8",...
elsif ($ENV{COMMAND_LINE}) { $shell = "tcsh"; require Complete::Tcsh; ($words,$cword) = @{ Complete::Tcsh::parse_cmdline() }; }
@ARGV = @$words;

# strip program name
shift @$words; $cword--;

# parse common_opts which potentially sets subcommand
{
    require Getopt::Long;
    my $old_go_conf = Getopt::Long::Configure('pass_through', 'no_ignore_case', 'bundling', 'no_auto_abbrev', 'no_getopt_compat', 'gnu_compat');
    my @go_spec;
    for my $k (keys %$copts) { push @go_spec, $copts->{$k}{getopt} => sub { my ($go, $val) = @_; $copts->{$k}{handler}->($go, $val, $r); } }
    Getopt::Long::GetOptions(@go_spec);
    Getopt::Long::Configure($old_go_conf);
}

# select subcommand
my $scn = $r->{subcommand_name};
my $scn_from = $r->{subcommand_name_from};
if (!defined($scn) && defined($args->{default_subcommand})) {
    # get from default_subcommand
    if ($args->{get_subcommand_from_arg} == 1) {
        $scn = $args->{default_subcommand};
        $scn_from = "default_subcommand";
    } elsif ($args->{get_subcommand_from_arg} == 2 && !@ARGV) {
        $scn = $args->{default_subcommand};
        $scn_from = "default_subcommand";
    }
}
if (!defined($scn) && $args->{subcommands} && @ARGV) {
    # get from first command-line arg
    $scn = shift @ARGV;
    $scn_from = "arg";
}

if (defined($scn) && !$sc_metas->{$scn}) { undef $scn } # unknown subcommand name
# pass meta for Complete::Getopt::Long
$r->{meta} = defined($scn) ? $sc_metas->{$scn} : $meta;

# XXX read_env

# complete with periscomp
my $compres;
{
    require Perinci::Sub::Complete;
    $compres = Perinci::Sub::Complete::complete_cli_arg(
        meta => $r->{meta},
        words => $words,
        cword => $cword,



( run in 1.049 second using v1.01-cache-2.11-cpan-39bf76dae61 )