App-Genpass-WordList
view release on metacpan or search on metacpan
script/_genpass-wordlist view on Meta::CPAN
defined($toc_line)
or die "Unexpected end of data section while reading TOC line #$i";
chomp($toc_line);
$toc_line =~ /\S/ or last;
$toc_line =~ /^([^,]+),(\d+),(\d+)(?:,(.*))?$/
or die "Invalid TOC line #$i in data section: $toc_line";
$toc{$1} = [$2, $3, $4];
}
my $pos = tell $fh;
$toc{$_}[0] += $pos for keys %toc;
# 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]}) {
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;
}
return;
};
}
# END DATAPACK CODE
# Note: This completer script is generated by App::GenPericmdCompleterScript version 0.11
# on Tue Jan 2 11:22:14 2018. You probably should not manually edit this file.
# NO_PERINCI_CMDLINE_SCRIPT
# PERINCI_CMDLINE_COMPLETER_SCRIPT: {program_name=>"genpass-wordlist",read_config=>0,read_env=>0,skip_format=>undef,subcommands=>undef,url=>"/App/Genpass/WordList/genpass"}
# FRAGMENT id=shcompgen-hint completer=1 for=genpass-wordlist
our $DATE = '2018-01-02'; # DATE
our $VERSION = '0.002'; # VERSION
# PODNAME: _genpass-wordlist
# ABSTRACT: Completer script for genpass-wordlist
use 5.010;
use strict;
use warnings;
die "Please run this script under shell completion\n" unless $ENV{COMP_LINE} || $ENV{COMMAND_LINE};
my $args = {program_name=>"genpass-wordlist",read_config=>0,read_env=>0,skip_format=>undef,subcommands=>undef,url=>"/App/Genpass/WordList/genpass"};
my $meta = {_orig_args_as=>undef,_orig_result_naked=>undef,args=>{num=>{cmdline_aliases=>{n=>{}},default=>1,schema=>["int",{min=>1,req=>1},{}]},patterns=>{cmdline_aliases=>{p=>{}},default=>["%w %w %w","%w %w %w %w","%w %w %w %w %w","%w %w %w %w %w %w...
my $sc_metas = {};
my $copts = {format=>{default=>undef,getopt=>"format=s",handler=>sub{package Perinci::CmdLine::Base;use warnings;use strict;no feature;use feature ':5.10';my($go, $val, $r) = @_;$$r{'format'} = $val},is_settable_via_config=>1,schema=>["str*","in",["t...
my $r = {};
# 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
# XXX read_env
# complete with periscomp
my $compres;
{
require Perinci::Sub::Complete;
$compres = Perinci::Sub::Complete::complete_cli_arg(
meta => defined($scn) ? $sc_metas->{$scn} : $meta,
words => $words,
cword => $cword,
common_opts => $copts,
riap_server_url => undef,
riap_uri => undef,
script/_genpass-wordlist view on Meta::CPAN
# unless ($ge_5140) {
# $mod =~ s/[adlu]//g;
# }
#
# if ($args{with_qr}) {
# return "qr($pat)$mod";
# } else {
# if ($ge_5140) {
# return "(^$mod:$pat)";
# } else {
# return "(?:(?$mod-)$pat)";
# }
# }
#}
#
#1;
#
#__END__
#
### Sah/Schema/rinci/function_meta.pm ###
#package Sah::Schema::rinci::function_meta;
#
#our $DATE = '2016-12-26';
#our $VERSION = '1.1.82.2';
#
#use 5.010001;
#use strict;
#use warnings;
#
#use Data::Sah::Normalize ();
#use Sah::Schema::rinci::meta ();
#
#our $schema = [hash => {
# summary => 'Rinci function metadata',
#
# _ver => 1.1,
# _prop => {
# %Sah::Schema::rinci::meta::_dh_props,
#
# entity_v => {},
# entity_date => {},
# links => {},
#
# is_func => {},
# is_meth => {},
# is_class_meth => {},
# args => {
# _value_prop => {
# %Sah::Schema::rinci::meta::_dh_props,
#
# links => {},
#
# schema => {},
# filters => {},
# default => {},
# req => {},
# pos => {},
# greedy => {},
# partial => {},
# stream => {},
# is_password => {},
# cmdline_aliases => {
# _value_prop => {
# summary => {},
# description => {},
# schema => {},
# code => {},
# is_flag => {},
# },
# },
# cmdline_on_getopt => {},
# cmdline_prompt => {},
# completion => {},
# index_completion => {},
# element_completion => {},
# cmdline_src => {},
# meta => 'fix',
# element_meta => 'fix',
# deps => {
# _keys => {
# arg => {},
# all => {},
# any => {},
# none => {},
# },
# },
# },
# },
# args_as => {},
# args_rels => {},
# result => {
# _prop => {
# %Sah::Schema::rinci::meta::_dh_props,
#
# schema => {},
# statuses => {
# _value_prop => {
# summary => {},
# description => {},
# schema => {},
# },
# },
# partial => {},
# stream => {},
# },
# },
# result_naked => {},
# examples => {
# _elem_prop => {
# %Sah::Schema::rinci::meta::_dh_props,
#
# args => {},
# argv => {},
# src => {},
# src_plang => {},
# status => {},
# result => {},
# test => {},
# },
# },
# features => {
script/_genpass-wordlist view on Meta::CPAN
#use warnings;
#
#use Sah::Schema::rinci::meta;
#
#our $schema = [hash => {
# summary => 'Rinci envelope result metadata',
#
# _ver => 1.1,
# _prop => {
# %Sah::Schema::rinci::meta::_dh_props,
#
# perm_err => {},
# func => {},
# cmdline => {},
# logs => {},
# prev => {},
# results => {},
# part_start => {},
# part_len => {},
# len => {},
# stream => {},
# },
#}, {}];
#
#1;
#
#__END__
#
### Sah/SchemaR/rinci/function_meta.pm ###
#package Sah::SchemaR::rinci::function_meta;
#
#our $DATE = '2016-12-26';
#our $VERSION = '1.1.82.2';
#
#our $rschema = do {
# my $a = [
# "hash",
# [
# {
# _prop => {
# args => {
# _value_prop => {
# caption => {},
# cmdline_aliases => {
# _value_prop => { code => {}, description => {}, is_flag => {}, schema => {}, summary => {} },
# },
# cmdline_on_getopt => {},
# cmdline_prompt => {},
# cmdline_src => {},
# completion => {},
# default => {},
# default_lang => {},
# defhash_v => {},
# deps => { _keys => { all => {}, any => {}, arg => {}, none => {} } },
# description => {},
# element_completion => {},
# element_meta => { _prop => 'fix', _ver => 1.1, summary => "Rinci function metadata" },
# filters => {},
# greedy => {},
# index_completion => {},
# is_password => {},
# links => {},
# meta => 'fix',
# name => {},
# partial => {},
# pos => {},
# req => {},
# schema => {},
# stream => {},
# summary => {},
# tags => {},
# v => {},
# x => {},
# },
# },
# args_as => {},
# args_rels => {},
# caption => 'fix',
# default_lang => 'fix',
# defhash_v => 'fix',
# deps => {
# _keys => {
# all => {},
# any => {},
# code => {},
# env => {},
# func => {},
# none => {},
# pkg => {},
# prog => {},
# tmp_dir => {},
# trash_dir => {},
# },
# },
# description => 'fix',
# entity_date => {},
# entity_v => {},
# examples => {
# _elem_prop => {
# args => {},
# argv => {},
# caption => 'fix',
# default_lang => 'fix',
# defhash_v => 'fix',
# description => 'fix',
# name => 'fix',
# result => {},
# src => {},
# src_plang => {},
# status => {},
# summary => 'fix',
# tags => 'fix',
# test => {},
# v => 'fix',
# x => 'fix',
# },
# },
# features => {
# _keys => {
# check_arg => {},
# dry_run => {},
( run in 0.690 second using v1.01-cache-2.11-cpan-f56aa216473 )