view release on metacpan or search on metacpan
lib/App/Egaz/Command/blastlink.pm view on Meta::CPAN
MARKDOWN
return $desc;
}
sub validate_args {
my ( $self, $opt, $args ) = @_;
if ( @{$args} != 1 ) {
my $message = "This command need one input file.\n\tIt found";
$message .= sprintf " [%s]", $_ for @{$args};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ElasticSearch/Utilities.pm view on Meta::CPAN
$options->{command} = $url;
my $index;
if( exists $options->{index} ) {
if( my $index_in = delete $options->{index} ) {
# No need to validate _all
if( $index_in eq '_all') {
$index = $index_in;
}
else {
# Validate each included index
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Env.pm view on Meta::CPAN
}
#-------------------------------------------------------
sub config {
my %default = Params::Validate::validate( @_, \%OptionDefaults );
$OptionDefaults{$_}{default} = $default{$_} for keys %default;
return;
}
#-------------------------------------------------------
lib/App/Env.pm view on Meta::CPAN
#-------------------------------------------------------
sub clone {
my $self = shift;
my %nopt = Params::Validate::validate( @_, \%CloneOptions );
my $clone = Storable::dclone( $self );
delete ${$clone}->{id};
# create new cache id
lib/App/Env.pm view on Meta::CPAN
# are being loaded in one call. Checking caching requires that we generate
# a cacheid from the applications' cacheids.
# if import is called as import( [$app, \%opts], \%shared_opts ),
# this is equivalent to import( $app, { %shared_opts, %opts } ),
# but we still validate %shared_opts as SharedOptions, just to be
# precise.
# if there's a single application passed as a scalar (rather than
# an array containing the app name and options), treat @opts as
# ApplicationOptions, else SharedOptions
my %opts = Params::Validate::validate( @opts, @apps == 1 && !ref( $apps[0] )
? \%ApplicationOptions
: \%SharedOptions );
$opts{Cache} = 0 if $opts{Temp};
lib/App/Env.pm view on Meta::CPAN
}
}
}
# set forced options for apps in multi-app merges, otherwise
# the defaults will be set by the call to validate below.
if ( @apps > 1 ) {
$app_opt{Force} = 1;
$app_opt{Cache} = 0;
}
# validate possible application options and get default
# values. Params::Validate wants a real array
my ( @app_opts ) = %app_opt;
# return an environment object, but don't load it. we need the
# module name to create a cacheid for the merged environment.
# don't load now to prevent unnecessary loading of uncached
# environments if later it turns out this is a cached
# multi-application environment
%app_opt = ( Params::Validate::validate( @app_opts, \%ApplicationOptions ) );
my $appo = App::Env::_app->new(
pid => $self->lobject_id,
app => $app,
NoLoad => 1,
opt => \%app_opt,
lib/App/Env.pm view on Meta::CPAN
sub env {
my $self = shift;
my @opts = ( 'HASH' eq ref $_[-1] ? pop : {} );
# mostly a duplicate of what's in str(). ick.
my %opt = Params::Validate::validate(
@opts,
{
Exclude => {
callbacks => { 'type' => \&App::Env::_Util::exclude_param_check },
default => undef,
lib/App/Env.pm view on Meta::CPAN
# return an env compatible string
sub str {
my $self = shift;
my @opts = ( 'HASH' eq ref $_[-1] ? pop : {} );
# validate type. Params::Validate doesn't do Regexp, so
# this is a bit messy.
my %opt = Params::Validate::validate(
@opts,
{
Exclude => {
callbacks => { 'type' => \&App::Env::_Util::exclude_param_check },
optional => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Environ/Mojo/Pg.pm view on Meta::CPAN
use v5.10;
use utf8;
use App::Environ;
use App::Environ::Config;
use Params::Validate qw(validate_pos);
use URI;
use Mojo::Pg;
my %PG;
App::Environ::Config->register(qw(pg.yml));
sub pg {
my $class = shift;
my ($connector) = validate_pos( @_, 1 );
unless ( defined $PG{$connector} ) {
my $pg_string = $class->pg_string($connector);
$PG{$connector} = Mojo::Pg->new($pg_string);
lib/App/Environ/Mojo/Pg.pm view on Meta::CPAN
}
sub pg_string {
my $class = shift;
my ($connector) = validate_pos( @_, 1 );
my $conf = App::Environ::Config->instance->{pg}{connectors}{$connector};
my $url = URI->new();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Environ/Que.pm view on Meta::CPAN
use App::Environ;
use App::Environ::Mojo::Pg;
use Carp qw(croak);
use Cpanel::JSON::XS;
use Params::Validate qw( validate_pos validate );
my $INSTANCE;
my $sql = q{
INSERT INTO public.que_jobs
lib/App/Environ/Que.pm view on Meta::CPAN
my $JSON = Cpanel::JSON::XS->new;
sub instance {
my $class = shift;
my ($connector) = validate_pos( @_, 1 );
unless ($INSTANCE) {
my $pg = App::Environ::Mojo::Pg->pg($connector);
$INSTANCE = bless { pg => $pg }, $class;
}
lib/App/Environ/Que.pm view on Meta::CPAN
my __PACKAGE__ $self = shift;
my $cb = pop;
croak 'No cb' unless $cb;
my %params = validate( @_, $VALIDATION{enqueue} );
my $args = $JSON->encode( $params{args} );
$self->{pg}->db->query(
$sql,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ErrorCalculator.pm view on Meta::CPAN
$table->attach_defaults(
$funcentry, 1, 2, # left/right
1, 2, # top/bottom
);
$funcentry->signal_connect(
activate => \&_validate_func,
);
$funcentry->signal_connect(
changed => \&_validate_func,
);
$funcentry->set_text('f = a * x^2');
$funcentry->show;
my $inentry = Gtk2::Entry->new;
lib/App/ErrorCalculator.pm view on Meta::CPAN
my $valbutton = Gtk2::Button->new('Validate');
$table->attach_defaults(
$valbutton, 2, 3, # left/right
1, 2, # top/bottom
);
$valbutton->signal_connect( clicked => \&_validate_func );
$valbutton->show;
my $inbutton = Gtk2::Button->new('Select File');
$table->attach_defaults(
$inbutton, 2, 3, # left/right
lib/App/ErrorCalculator.pm view on Meta::CPAN
$func = $func->apply_derivatives()->simplify();
return($nobj, $func);
}
my ($name, $body);
sub _validate_func {
my $f = $funcentry->get_text;
($name, $body) = _parse_function($f);
if (not defined $name) {
$funclabel->set_text('Invalid Function');
}
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
script/exifshow view on Meta::CPAN
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...
You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...
To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:
[plugin=DumpArgs]
-event=before_validate_args
-prio=99
[plugin=Foo]
-event=after_validate_args
arg1=val1
arg2=val2
which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.
List of available configuration parameters:
filename (see --filename)
format (see --format)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/EC2.pm view on Meta::CPAN
]
);
}
########################################################################
sub validate_subnets {
########################################################################
my ( $self, $subnets ) = @_;
# flatten private, public subnets
my @all_subnets = map { @{ $subnets->{$_} // [] } } keys %{$subnets};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Fasops/Command/axt2fas.pm view on Meta::CPAN
MARKDOWN
return $desc;
}
sub validate_args {
my ( $self, $opt, $args ) = @_;
if ( !@{$args} ) {
my $message = "This command need one or more input files.\n\tIt found";
$message .= sprintf " [%s]", $_ for @{$args};
view all matches for this distribution
view release on metacpan or search on metacpan
t/App-Fetchware-lookup.t view on Meta::CPAN
<i>or</i>,
% gpg --import KEYS
% gpg --verify httpd-2.2.8.tar.gz.asc
</pre>
<p>We offer MD5 hashes as an alternative to validate the integrity
of the downloaded files. A unix program called <code>md5</code> or
<code>md5sum</code> is included in many unix distributions. It is
also available as part of <a
href="http://www.gnu.org/software/textutils/textutils.html">GNU
Textutils</a>. Windows users can get binary md5 programs from <a
view all matches for this distribution
view release on metacpan or search on metacpan
script/reencode-video-with-libx264 view on Meta::CPAN
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...
You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...
To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:
[plugin=DumpArgs]
-event=before_validate_args
-prio=99
[plugin=Foo]
-event=after_validate_args
arg1=val1
arg2=val2
which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.
List of available configuration parameters:
audio_sample_rate (see --audio-sample-rate)
crf (see --crf)
view all matches for this distribution
view release on metacpan or search on metacpan
script/digest-files view on Meta::CPAN
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...
You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...
To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:
[plugin=DumpArgs]
-event=before_validate_args
-prio=99
[plugin=Foo]
-event=after_validate_args
arg1=val1
arg2=val2
which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.
List of available configuration parameters:
algorithm (see --algorithm)
digest_args (see --digest-args)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FilterUtils/2base.pm view on Meta::CPAN
[ 'version|v' => "show version number" ],
[ 'help|h' => "display a usage message" ],
);
}
sub validate_args {
my ($self, $opt, $args) = @_;
if ($opt->{'help'} || !@$args) {
my ($opt, $usage) = describe_options(
usage_desc(),
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FirefoxMultiAccountContainersUtils.pm view on Meta::CPAN
summary => 'Name for the new container',
schema => ['str*', min_len=>1],
pos => 1,
},
color => {
schema => ['str*', match=>qr/\A\w+\z/], # XXX currently not validated for valid values
},
icon => {
schema => ['str*', match=>qr/\A\w+\z/], # XXX currently not validated for valid values
},
},
features => {
dry_run => 1,
},
view all matches for this distribution
view release on metacpan or search on metacpan
script/restart-firefox view on Meta::CPAN
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...
You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...
To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:
[plugin=DumpArgs]
-event=before_validate_args
-prio=99
[plugin=Foo]
-event=after_validate_args
arg1=val1
arg2=val2
which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.
List of available configuration parameters:
firefox_cmd (see --firefox-cmd)
format (see --format)
view all matches for this distribution
view release on metacpan or search on metacpan
script/gen-fish-complete-from-getopt-long-complete-script view on Meta::CPAN
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...
You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...
To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:
[plugin=DumpArgs]
-event=before_validate_args
-prio=99
[plugin=Foo]
-event=after_validate_args
arg1=val1
arg2=val2
which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.
List of available configuration parameters:
cmdname (see --cmdname)
compname (see --compname)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Foca/Server.pm view on Meta::CPAN
(open3).
Now the question is.. is Foca secure? Well it depends on you. Depends if you
run it as non-root user and the commands you define. Foca will try to do
things to protect, for example it will reject all requests that have pipes (|),
I/O redirection (>, <, <<, >>), additionally the HTTP request will be validated
before it gets executed via the call of C<validate_request()> (L<App::Foca::Server>
returns true all the time so if you want to add extra functionality please
create a subclass and re-define the method).
=head1 EXAMPLE
lib/App/Foca/Server.pm view on Meta::CPAN
# Ok, the command is valid?
unless ($commands->{$command}) {
return $self->build_response(HTTP_NOT_FOUND, "Unknown command");
}
# Validate request
my ($is_valid, $msg) = $self->validate_request($command, $request);
unless ($is_valid) {
if ($msg) {
return $self->build_response(HTTP_FORBIDDEN, $msg);
} else {
return $self->build_response(HTTP_FORBIDDEN);
lib/App/Foca/Server.pm view on Meta::CPAN
my ($self, $code, $body) = @_;
my $res = HTTP::Response->new($code, status_message($code));
my %default_headers = (
pragma => "must-revalidate, no-cache, no-store, expires: -1",
no_cache => 1,
expires => -1,
cache_control => "no-cache, no-store, must-revalidate",
content_type => 'text/plain',
);
while(my($k, $v) = each %default_headers) {
$res->header($k, $v);
}
# A body?
$res->content($body) if $body;
return $res;
}
=head2 B<validate_request($command, $request)>
re-define this method if you want to add some extra security. By default all
requests are valid at this point.
=cut
sub validate_request {
my ($self, $command, $request) = @_;
return 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ForExample/Catalog.pm view on Meta::CPAN
# alias 'my-monit'='monit -vc [% home %]/monitrc'
#
# my-monit
# my-monit start all
# my-monit quit
# my-monit validate
# ...
#
_END_
;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FromUnixtime.pm view on Meta::CPAN
print "$0 $VERSION\n";
exit 1;
},
) or _show_usage(2);
_validate_options($config, $argv);
}
sub _validate_options {
my ($config, $argv) = @_;
$config->{format} ||= RC->{format} || $DEFAULT_DATE_FORMAT;
$config->{'start-bracket'} ||= RC->{'start-bracket'} || '(';
$config->{'end-bracket'} ||= RC->{'end-bracket'} || ')';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GSD.pm view on Meta::CPAN
}
return $cmd;
}
# Try to invalidate nscd/unscd cache if present
sub _flush_nscd {
my $self = shift;
return if $^O ne 'linux';
for my $nscd (qw(nscd unscd)) {
# Ignore errors if the daemon is installed, but not running
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
script/gen-pericmd-completer view on Meta::CPAN
You can also put configuration for multiple programs inside a single file, and use filter C<program=NAME> in section names, e.g. C<[program=NAME ...]> or C<[SOMESECTION program=NAME]>. The section will then only be used when the reading program match...
You can also filter a section by environment variable using the filter C<env=CONDITION> in section names. For example if you only want a section to be read if a certain environment variable is true: C<[env=SOMEVAR ...]> or C<[SOMESECTION env=SOMEVAR ...
To load and configure plugins, you can use either the C<-plugins> parameter (e.g. C<< -plugins=DumpArgs >> or C<< -plugins=DumpArgs@before_validate_args >>), or use the C<[plugin=NAME ...]> sections, for example:
[plugin=DumpArgs]
-event=before_validate_args
-prio=99
[plugin=Foo]
-event=after_validate_args
arg1=val1
arg2=val2
which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.
List of available configuration parameters:
completion (see --completion)
default_subcommand (see --default-subcommand)
view all matches for this distribution
view release on metacpan or search on metacpan
script/gen-pericmd-script view on Meta::CPAN
=item B<--use-utf8>
Whether to set utf8 flag on output, will be passed to Perinci::CmdLine constructor.
=item B<--validate-args>
Will be passed to Perinci::CmdLine constructor.
=back
script/gen-pericmd-script view on Meta::CPAN
subcommands (see --subcommand)
subcommands_from_package_functions (see --subcommands-from-package-functions)
url (see --url)
use_cleanser (see --use-cleanser)
use_utf8 (see --use-utf8)
validate_args (see --validate-args)
=head1 ENVIRONMENT
=head2 GEN_PERICMD_SCRIPT_OPT => str
view all matches for this distribution
view release on metacpan or search on metacpan
script/genpass-id view on Meta::CPAN
### code_after_shebang
# Note: This script is a CLI for Riap function /App/Genpass/ID/genpass
# and generated automatically using Perinci::CmdLine::Gen version 0.483
# PERICMD_INLINE_SCRIPT: {"code_after_shebang":"...","config_dirs":null,"config_filename":"genpass-id.conf","env_name":"GENPASS_ID_OPT","include":null,"log":null,"pack_deps":1,"pod":0,"read_config":1,"read_env":1,"script_name":"genpass-id","script_su...
my $_pci_metas = {""=>{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","%W%4d%W","%W%6d%s"],description=>...
# This script is generated by Perinci::CmdLine::Inline version 0.541 on Tue Jan 2 11:42:34 2018.
view all matches for this distribution
view release on metacpan or search on metacpan
script/genpass-wordlist view on Meta::CPAN
### code_after_shebang
# Note: This script is a CLI for Riap function /App/Genpass/WordList/genpass
# and generated automatically using Perinci::CmdLine::Gen version 0.483
# PERICMD_INLINE_SCRIPT: {"code_after_shebang":"...","config_dirs":null,"config_filename":"genpass-wordlist.conf","env_name":"GENPASS_WORDLIST_OPT","include":null,"log":null,"pack_deps":1,"pod":0,"read_config":1,"read_env":1,"script_name":"genpass-wo...
my $_pci_metas = {""=>{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","%W%4d%W","%W%6d%s"],description=>...
# This script is generated by Perinci::CmdLine::Inline version 0.541 on Tue Jan 2 11:22:14 2018.
view all matches for this distribution