App-genpw-base64

 view release on metacpan or  search on metacpan

script/genpw-base64  view on Meta::CPAN

};
my $go_spec2 = {
    'format=s' => sub {  },
    'help|h|?' => sub {  },
    'json' => sub {  },
    'l=s' => sub {         $_pci_args{'len'} = $_[1];
 },
    'len=s' => sub {         $_pci_args{'len'} = $_[1];
 },
    'max-len=s' => sub {         $_pci_args{'max_len'} = $_[1];
 },
    'min-len=s' => sub {         $_pci_args{'min_len'} = $_[1];
 },
    'n=s' => sub {         $_pci_args{'num'} = $_[1];
 },
    'naked-res' => sub {  },
    'no-naked-res|nonaked-res' => sub {  },
    'num=s' => sub {         $_pci_args{'num'} = $_[1];
 },
    'version|v' => sub {  },
};
my $old_conf = Getopt::Long::EvenLess::Configure("pass_through");
Getopt::Long::EvenLess::GetOptions(%$go_spec1);
Getopt::Long::EvenLess::Configure($old_conf);
my $res = Getopt::Long::EvenLess::GetOptions(%$go_spec2);
_pci_err([500, "GetOptions failed"]) unless $res;
}

### check arguments

{
require Local::_pci_check_args; my $res = _pci_check_args(\%_pci_args);
_pci_err($res) if $res->[0] != 200;
$_pci_r->{args} = \%_pci_args;
}

### call function

{
my $sc_name = $_pci_r->{subcommand_name};
if ($sc_name eq "") {
    $_pci_meta_result_type = "";
    require App::genpw::base64;
    eval { $_pci_r->{res} = App::genpw::base64::genpw(%_pci_args) };
    if ($@) { $_pci_r->{res} = [500, "Function died: $@"] }
}
}

### format & display result

{
my $fres;
my $save_res; if (exists $_pci_r->{res}[3]{"cmdline.result"}) { $save_res = $_pci_r->{res}[2]; $_pci_r->{res}[2] = $_pci_r->{res}[3]{"cmdline.result"} }
my $is_success = $_pci_r->{res}[0] =~ /\A2/ || $_pci_r->{res}[0] == 304;
my $is_stream = $_pci_r->{res}[3]{stream} // $_pci_meta_result_stream // 0;
if ($is_success && (0 || $_pci_meta_skip_format || $_pci_r->{res}[3]{"cmdline.skip_format"})) { $fres = $_pci_r->{res}[2] }
elsif ($is_success && $is_stream) {}
else { require Local::_pci_clean_json; require Perinci::Result::Format::Lite; $is_stream=0; _pci_clean_json($_pci_r->{res}); $fres = Perinci::Result::Format::Lite::format($_pci_r->{res}, ($_pci_r->{format} // $_pci_r->{res}[3]{"cmdline.default_format...

my $use_utf8 = $_pci_r->{res}[3]{"x.hint.result_binary"} ? 0 : 0;
if ($use_utf8) { binmode STDOUT, ":encoding(utf8)" }
if ($is_stream) {
    my $code = $_pci_r->{res}[2]; if (ref($code) ne "CODE") { die "Result is a stream but no coderef provided" } if ($_pci_meta_result_type_is_simple) { while(defined(my $l=$code->())) { print $l; print "\n" unless $_pci_meta_result_type eq "buf"; } ...
} else {
    print $fres;
}
if (defined $save_res) { $_pci_r->{res}[2] = $save_res }
}

### exit

{
my $status = $_pci_r->{res}[0];
my $exit_code = $_pci_r->{res}[3]{"cmdline.exit_code"} // ($status =~ /200|304/ ? 0 : ($status-300));
exit($exit_code);
}

=pod

=encoding UTF-8

=head1 NAME

genpw-base64 - Generate random password using base64 characters

=head1 VERSION

This document describes version 0.001 of main (from Perl distribution App-genpw-base64), released on 2018-02-20.

=head1 SYNOPSIS

Usage:

 % genpw-base64 [options] [num]

=head1 DESCRIPTION

=head1 OPTIONS

C<*> marks required options.

=head2 Main options

=over

=item B<--len>=I<s>, B<-l>

If no pattern is supplied, will generate random alphanum characters with this exact length.

=item B<--max-len>=I<s>

If no pattern is supplied, will generate random alphanum characters with this maximum length.

=item B<--min-len>=I<s>

If no pattern is supplied, will generate random alphanum characters with this minimum length.

=item B<--num>=I<s>, B<-n>

Default value:



( run in 0.846 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )