view release on metacpan or search on metacpan
lib/App/BCVI/NotifyClient.pm view on Meta::CPAN
sub _notify_get_options {
my($self, @args) = @_;
local(@ARGV) = @args;
my %opt = ();
Getopt::Long::GetOptions(\%opt,
'--idle|i:i',
'--output|o:i',
'--tty|t=s',
view all matches for this distribution
view release on metacpan or search on metacpan
my($class, @args) = @_;
my $opt = $class->option_defaults();
my @cfg = $class->getopt_config();
local(@ARGV) = @args;
Getopt::Long::GetOptions($opt, @cfg) or $class->die_synopsis();
my $handler = $opt->{listener}
? $class->server_class
: $class->client_class;
view all matches for this distribution
view release on metacpan or search on metacpan
$rv || 0;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Base/Script/Common.pm view on Meta::CPAN
sub _parse_arguments {
my $self = shift;
my $args = shift;
local @ARGV = (@$args);
# Build the hash of options to pass to Getopt::Long
my $options = $self->all_options;
my %options_hash = ();
my %getopt_args = ();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/BashHistoryUtils.pm view on Meta::CPAN
undef $main::TS;
}
};
}
local @ARGV = ($histfile);
my $stdout = Capture::Tiny::capture_stdout(
sub {
Bash::History::Read::each_hist($code);
}
);
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/lastaccess view on Meta::CPAN
my $elps = sprintf "%.6f" , tv_interval $start_time ;
say STDERR CYAN "Files processed : $num ; Shown above : $shown ; Elapsed seconds : $elps" ;
}
sub HELP_MESSAGE { # <-- - ãµãã³ãã³ããå¼ã°ãã¦ããã¨ãã¯ãã®ãã«ããå¼ã°ããã
local @ARGV = do { my ($x,@y) = 0 ; 1 while ( @y = caller $x++ )[ 0 ] eq "Getopt::Std" ; $y[1] } ;
Pod::Perldoc -> run ;
}
sub VERSION_MESSAGE { $ Getopt::Std::STANDARD_HELP_VERSION = 1 } # <- here?
view all matches for this distribution
view release on metacpan or search on metacpan
script/block-web-flooders view on Meta::CPAN
}
sub action_unblock_all {
_init();
local @ARGV = keys %Blocked;
_block_or_unblock_ips("unblock");
_set_need_reload(1);
}
sub action_run {
view all matches for this distribution
view release on metacpan or search on metacpan
my $image = "t/test.png";
plan skip_all => "Test image $image not found" unless -e $image;
# Simulate @ARGV as CLI would receive it
local @ARGV = ($image);
# Run the CLI logic
App::BlurFill::CLI->new->run;
# Check for the expected output file
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/TestAppBuild.pm view on Meta::CPAN
local $Test::Builder::Level = $Test::Builder::Level + 1;
eq_or_diff( $found, $fixed_tree );
}
sub touch_file {
local @ARGV = $_[0];
ExtUtils::Command::touch();
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-App-CPAN-Mini-Visit.t view on Meta::CPAN
} => \$stdout,
\$stderr;
};
catch my $err;
ok( -f $tempfile, "[$label] output file created" );
my @found = map { chomp; $_ } do { local @ARGV = ($tempfile); <> };
is( $stdout, '', "[$label] saw no output on terminal" );
is_deeply( \@found, \@files, "[$label] listing correct" );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CPANGhq.pm view on Meta::CPAN
my $parser = Getopt::Long::Parser->new(
config => [qw/posix_default no_ignore_case bundling pass_through auto_help/],
);
local @ARGV = @argv;
$parser->getoptions(\my %opt) or Pod::Usage::pod2usage(1);
@argv = @ARGV;
(\%opt, \@argv);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CPANRepo.pm view on Meta::CPAN
my $parser = Getopt::Long::Parser->new(
config => [qw/posix_default no_ignore_case bundling pass_through auto_help/],
);
local @ARGV = @argv;
$parser->getoptions(\my %opt) or Pod::Usage::pod2usage(1);
@argv = @ARGV;
Pod::Usage::pod2usage(1) unless @argv;
(\%opt, \@argv);
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-help.t view on Meta::CPAN
use App::CSE;
my $cse = App::CSE->new();
{
local @ARGV = ( 'help' , '--verbose' );
ok( $cse->version() , "Ok got a version");
ok( $cse->command()->isa('App::CSE::Command::Help') , "Ok good command instance");
ok( $cse->main() , "Ok can execute the magic command");
ok( $cse->options()->{verbose} , "Ok verbose is set");
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/02-basic.t view on Meta::CPAN
111,222,333
.
sub setup {
my $input = shift;
local @ARGV = @_;
my $output_fh = IO::String->new;
my $ac = App::CSV->new_with_options(
_input_fh => IO::String->new($input),
_output_fh => $output_fh);
return($ac, $output_fh->string_ref);
view all matches for this distribution
view release on metacpan or search on metacpan
$obj->run;
ok -f $latex;
my $content = do { local (@ARGV, $/) = $latex; <> };
like_string $content, qr/begin\{table\}/;
like_string $content, qr/Name & Age & City \\\\/;
}
done_testing();
view all matches for this distribution
view release on metacpan or search on metacpan
inc/My/Module/Build.pm view on Meta::CPAN
*read_file = \&My::Module::Build::read_file; }
use Test::More;
use Fatal qw(mkdir chdir);
local @ARGV = qw(--noinstall-everything);
my $define_options =
My::Tests::Below->pod_code_snippet("option-graph");
$define_options =~ s/\.\.\.//g;
my $builder = eval $define_options; die $@ if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Chained.pm view on Meta::CPAN
my @command_line_arguments = @{$self->{command_line_arguments}} ;
if(@command_line_arguments)
{
local @ARGV = @command_line_arguments ;
my @option_definitions = $self->get_options_definitions() ;
GetOptions(@option_definitions);
my @arguments_left_on_command_line = @ARGV ;
view all matches for this distribution
view release on metacpan or search on metacpan
t/05getopts.t view on Meta::CPAN
is( $trap->stdout, '', 'Expecting no STDOUT' );
is( $trap->stderr, '', 'Expecting no STDERR' );
is( $trap->die, undef, 'Expecting no die message' );
is( $getopts->option, undef, 'Expecting no die message' );
local @ARGV = '--option1';
$getopts = App::ClusterSSH::Getopt->new( parent => $mock_object );
trap {
$getopts->add_option( spec => 'option1' );
};
is( $trap->leaveby, 'return', 'adding an empty option failed' );
t/05getopts.t view on Meta::CPAN
is( $trap->stdout, '', 'Expecting no STDOUT' );
is( $trap->stderr, '', 'Expecting no STDERR' );
is( $trap->die, undef, 'Expecting no die message' );
is( $getopts->option1, 1, 'Expecting no die message' );
local @ARGV = ''; # @ARGV is never undef, but an empty string
$getopts = App::ClusterSSH::Getopt->new( parent => $mock_object );
trap {
$getopts->add_option( spec => 'option1', default => 5 );
};
is( $trap->leaveby, 'return', 'adding an empty option with a default value' );
t/05getopts.t view on Meta::CPAN
is( $trap->stdout, '', 'Expecting no STDOUT' );
is( $trap->stderr, '', 'Expecting no STDERR' );
is( $trap->die, undef, 'Expecting no die message' );
is( $getopts->option1, 5, 'correct default value' );
local @ARGV = ( '--option1', '8' );
$getopts = App::ClusterSSH::Getopt->new( parent => $mock_object );
trap {
$getopts->add_option( spec => 'option1=i', default => 5, );
};
is( $trap->leaveby, 'return', 'adding an empty option failed' );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Starter/Plugin/App/Cmd.pm view on Meta::CPAN
sub create_script {
my $self = shift;
my $script_dir = File::Spec->catdir($self->{basedir}, 'script');
unless (-d $script_dir) {
local @ARGV = $script_dir;
mkpath @ARGV;
$self->progress("Created $script_dir");
}
my $script_file = File::Spec->catfile($script_dir, $self->{script});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Cmd/ArgProcessor.pm view on Meta::CPAN
# ABSTRACT: App::Cmd-specific wrapper for Getopt::Long::Descriptive
sub _process_args {
my ($class, $args, @params) = @_;
local @ARGV = @$args;
require Getopt::Long::Descriptive;
Getopt::Long::Descriptive->VERSION(0.116)
if Getopt::Long::Descriptive->VERSION;
view all matches for this distribution
view release on metacpan or search on metacpan
expected_config => { 'bar' => '1' },
},
);
for my $test_name (keys %tests) {
local @ARGV = @{$tests{$test_name}->{ARGV}};
my $program = App::Commando::program('test');
$program->option('foo', '-f', '--foo', 'Enables foo');
$program->option('bar', '-b', '--bar', 'Enables bar');
$program->action(sub {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DBI/Loader.pm view on Meta::CPAN
use String::Unescape;
sub run
{
shift if @_ && eval { $_[0]->isa(__PACKAGE__) };
local (@ARGV) = @_;
my %opts;
getopts(Getopt::Config::FromPod->string, \%opts);
pod2usage(-verbose => 2) if exists $opts{h};
pod2usage(-msg => 'At least 2 arguments MUST be specified', -verbose => 0, -exitval => 1) if @ARGV < 2;
view all matches for this distribution
view release on metacpan or search on metacpan
t/cli/errors.t view on Meta::CPAN
# Test various errors.
eval { $docknot->run('foo') };
is_error($@, 'unknown command foo', 'Unknown command');
eval { $docknot->run('--bogus', 'generate') };
is_error($@, 'unknown option: bogus', 'Unknown top-level option');
local @ARGV = ();
eval { $docknot->run() };
is_error($@, 'no subcommand given', 'No subcommand');
eval { $docknot->run('generate', '-f', 'readme') };
is_error($@, 'generate: unknown option: f', 'Unknown option');
eval { $docknot->run('generate') };
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/EPAN.pm view on Meta::CPAN
my $action =
(scalar(@_) && length($_[0]) && (substr($_[0], 0, 1) ne '-'))
? shift(@_)
: 'list-actions';
$action =~ s{-}{_}gmxs;
local @ARGV = @_;
$self->action($action);
my %config = ();
GetOptions(
\%config,
qw(
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FTPThis.pm view on Meta::CPAN
);
say "Starting FTP server on port $self->{port} ...";
chdir $self->{root} or die "Can't chdir to $self->{root}: $!";
local @ARGV = (
"-C=$dir/conf",
"-p", $self->{port},
"-s", # daemon mode (not background, which is -S)
);
my $ftpd = Net::FTPServer::RO_FTPThis::Server->run;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FatPacker.pm view on Meta::CPAN
return [ @ARGV ];
}
sub lines_of {
map +(chomp,$_)[1], do { local @ARGV = ($_[0]); <> };
}
sub stripspace {
my ($text) = @_;
$text =~ /^(\s+)/ && $text =~ s/^$1//mg;
lib/App/FatPacker.pm view on Meta::CPAN
# This method can be overload in sub classes
# For example to skip POD
sub load_file {
my ($self, $file) = @_;
my $content = do {
local (@ARGV, $/) = ($file);
<>
};
close ARGV;
return $content;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/bin-fetchware-run.t view on Meta::CPAN
my $test_dist_md5 = md5sum_file($test_dist_path);
verbose_on();
{
local @ARGV = ('install', $test_dist_path);
fork_ok(sub { run() },
'Checked run() test-dist install success');
}
ok(-e catfile(fetchware_database_path(), 'test-dist-1.00.fpkg'),
t/bin-fetchware-run.t view on Meta::CPAN
verbose_on();
{
# Run with --keep-temp option.
local @ARGV = ('--keep-temp', 'install', $test_dist_path);
fork_ok(sub { print "TMP[$ENV{TMPDIR}]"; run() },
'Checked run() test-dist install success');
}
ok(-e catfile(fetchware_database_path(), 'test-dist-1.00.fpkg'),
t/bin-fetchware-run.t view on Meta::CPAN
# Clear internal %CONFIG variable, because I have to parse a Fetchwarefile
# twice, and it's only supported once.
__clear_CONFIG();
{
local @ARGV = ('uninstall', 'test-dist-1.00');
fork_ok(sub { run() },
'Checked run() uninstall test-dist success.');
}
ok(unlink($test_dist_path, $test_dist_md5),
t/bin-fetchware-run.t view on Meta::CPAN
ver_num => '1.01', destination_directory => $upgrade_temp_dir);
my $new_test_dist_path_md5 = md5sum_file($new_test_dist_path);
{
local @ARGV = ('upgrade', 'test-dist');
fork_ok(sub { run() },
'Checked run() @ARGV upgrade success');
}
print_ok(sub {cmd_list()},
t/bin-fetchware-run.t view on Meta::CPAN
# installed.
# Clear internal %CONFIG variable, because I have to pare a Fetchwarefile
# twice, and it's only supported once.
__clear_CONFIG();
{
local @ARGV = ('upgrade', 'test-dist');
fork_ok(sub { run() },
'Checked run() @ARGV upgrade version already installed');
}
# Clean up upgrade path.
t/bin-fetchware-run.t view on Meta::CPAN
my $new_another_dist_path_md5 = md5sum_file($new_another_dist_path);
# Upgrade all installed fetchware packages.
{
local @ARGV = ('upgrade-all');
fork_ok(sub { run() },
'Checked run() @ARGV upgrade-all success. ');
}
print_ok(sub {cmd_list()},
t/bin-fetchware-run.t view on Meta::CPAN
ok(cmd_install($test_dist_path),
'checked cmd_list() by installing a test-dist to list');
{
local @ARGV = ('list');
fork_ok(sub {
print_ok(sub {run()}, qr/test-dist-1\.00/,
'checked cmd_list() success.');
},
'Checked run() @ARGV list success');
t/bin-fetchware-run.t view on Meta::CPAN
my $test_dist_path = make_test_dist(file_name => 'test-dist',
ver_num => '1.00');
my $test_dist_md5 = md5sum_file($test_dist_path);
{
local @ARGV = ('look', $test_dist_path);
fork_ok(sub {run()},
'checked run() look success.');
}
# Cleanup the test-dist crap.
t/bin-fetchware-run.t view on Meta::CPAN
ok(-e $fetchware_tempdir, 'checked creating fetchware temporary directory.');
ok(-e $fetchwarefile_tempdir, 'checked creating Fetchwarefile temporary directory.');
# Delete newly created tempfiles.
{
local @ARGV = ('clean', $testing_tempdir);
fork_ok(sub {run()},
'checked run() clean success.');
}
ok(! -e $fetchware_tempdir,
t/bin-fetchware-run.t view on Meta::CPAN
# Tests run() when @ARGV's first value is *not* one of fetchware's allowable
# commands.
subtest 'test run() default' => sub {
{
local @ARGV = ();
fork_ok(sub {
print_ok(sub {run()},
qr/fetchware is a package manager for source code distributions. It gives you the/,
'Checked run() @ARGV = help with print_ok().');
},
t/bin-fetchware-run.t view on Meta::CPAN
# Now test that the same else is hit if an unrecognized command is
# specified.
{
local @ARGV = ('unrecognized');
fork_ok(sub {
print_ok(sub {run()},
qr/fetchware is a package manager for source code distributions. It gives you the/,
'Checked run() @ARGV = help with print_ok().');
},
t/bin-fetchware-run.t view on Meta::CPAN
# Tests run() when @ARGV's first value is *not* one of fetchware's allowable
# commands.
subtest 'test run() help' => sub {
{
local @ARGV = ('help');
fork_ok(sub {
print_ok(sub {run()},
qr/fetchware is a package manager for source code distributions. It gives you the/,
'Checked run() @ARGV = help with print_ok().');
},
t/bin-fetchware-run.t view on Meta::CPAN
};
subtest 'test run() command line options' => sub {
{
local @ARGV = '-h';
fork_ok(sub {
print_ok(sub {run()},
qr/fetchware is a package manager for source code distributions. It gives you the/,
'Checked run() @ARGV = -h with print_ok().');
},
'checked run() -h success.');
}
{
local @ARGV = '-?';
fork_ok(sub {
print_ok(sub {run()},
qr/fetchware is a package manager for source code distributions. It gives you the/,
'Checked run() @ARGV = -? with print_ok().');
},
'checked run() -? success.');
}
{
local @ARGV = '--help';
fork_ok(sub {
print_ok(sub {run()},
qr/fetchware is a package manager for source code distributions. It gives you the/,
'Checked run() @ARGV = --help with print_ok().');
},
'checked run() --help success.');
}
{
local @ARGV = '-V';
fork_ok(sub {
print_ok(sub {run()},
qr/Fetchware version \d.\d\d\d/,
'checked run() -V option success with print_ok().');
},
'Checked run() -V option success.');
}
{
local @ARGV = '--version';
fork_ok(sub {
print_ok(sub {run()},
qr/Fetchware version \d.\d\d\d/,
'checked run() --version option success with print_ok().');
},
view all matches for this distribution
view release on metacpan or search on metacpan
return $revision;
}
sub autofixup {
my $self = shift;
local @ARGV = @_;
print "# git-autofixup ", join(' ', @ARGV), "\n";
return Autofixup::main();
}
sub switch_to_downstream_branch {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Test/Git/Workflow/Command.pm view on Meta::CPAN
${"${module}::workflow"} = $workflow->new(git => $git);
if ($data->{workflow}) {
${"${module}::workflow"}->{$_} = $data->{workflow}{$_} for keys %{ $data->{workflow} };
}
local @ARGV = @{ $data->{ARGV} };
local %ENV = %ENV;
if ($data->{ENV}) {
$ENV{$_} = $data->{ENV}{$_} for keys %{ $data->{ENV} };
}
my $stdin;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GitHub/create.pm view on Meta::CPAN
my ( $name, $homepage, $description, $private, $public, $dry_run );
usage 0 unless @arguments;
{
local @ARGV = @arguments;
GetOptions(
'help|h|?' => \$help,
'login=s' => \$login,
'token=s' => \$token,
view all matches for this distribution