line |
true |
false |
branch |
30
|
39 |
0 |
if ($ENV{'TESTING_HOME'}) { } |
40
|
0 |
0 |
unless $homedir |
72
|
0 |
0 |
if ($type eq 'arg') { } |
|
0 |
0 |
elsif ($type eq 'optval') { } |
74
|
0 |
0 |
if ($argpos == 0 and not exists $seen_opts->{'-x'} and not exists $seen_opts->{'--execute'} and not exists $seen_opts->{'-e'} and not exists $seen_opts->{'--eval'}) { } |
84
|
0 |
0 |
ref $args{'opt'} eq 'ARRAY' ? : |
86
|
0 |
0 |
if (grep {$_ =~ /\A(-x|--execute|-D|--delete|-s|--show|-w|--write)\z/;} @$opts) |
90
|
0 |
0 |
unless $_ eq "-M" |
|
0 |
0 |
if (grep {$_ eq "--mode" unless $_ eq "-M";} @$opts) |
122
|
0 |
0 |
unless GetOptionsWithCompletion(sub {
my(%args) = @_;
my $word = $args{'word'};
my $type = $args{'type'};
my $seen_opts = $args{'seen_opts'};
if ($type eq "arg") {
my $argpos = $args{'argpos'};
if ($argpos == 0 and not exists $seen_opts->{'-x'} and not exists $seen_opts->{'--execute'} and not exists $seen_opts->{'-e'} and not exists $seen_opts->{'--eval'}) {
require Complete::App::perlmv;
return Complete::App::perlmv::complete_perlmv_scriptlet("word", $word);
}
else {
require Complete::File;
return Complete::File::complete_file("word", $word);
};
}
elsif ($type eq "optval") {
my $opts = ref $args{'opt'} eq "ARRAY" ? $args{'opt'} : [$args{'opt'}];
my @comps;
if (grep {$_ =~ /\A(-x|--execute|-D|--delete|-s|--show|-w|--write)\z/;} @$opts) {
require Complete::App::perlmv;
push @comps, Complete::App::perlmv::complete_perlmv_scriptlet("word", $word);
};
if (grep {$_ eq "--mode" unless $_ eq "-M";} @$opts) {
require Complete::Util;
push @comps, Complete::Util::complete_array_elem("word", $word, "array", ["copy", "symlink", "link", "move", "rename"]);
};
require Complete::Util;
return Complete::Util::combine_answers(@comps);
};
undef;
}
, "c|check", \$self->{'check'}, "D|delete=s", \$self->{'delete'}, "d|dry-run", \$self->{'dry_run'}, "e|eval=s", $self->{'codes'}, "h|help", sub {
$self->print_help;
}
, "l|list", \$self->{'list'}, "M|mode=s", \$self->{'mode'}, "o|overwrite", \$self->{'overwrite'}, "p|parents", \$self->{'parents'}, "R|recursive", \$self->{'recursive'}, "r|reverse", sub {
$self->{'sort_mode'} = -1;
}
, "s|show=s", \$self->{'show'}, "T|no-sort", sub {
$self->{'sort_mode'} = 0;
}
, "v|verbose", \$self->{'verbose'}, "w|write=s", \$self->{'write'}, "f|files", sub {
$self->{'process_dir'} = 0;
}
, "S|no-symlinks", sub {
$self->{'process_symlink'} = 0;
}
, "V|version", sub {
$self->print_version;
}
, "x|execute=s", sub {
push @{$$self{"codes"};}, \$_[1];
}
, "a|arg=s%", $self->{'args'}, "<>", sub {
$self->parse_extra_opts(@_);
}
) |
129
|
0 |
0 |
if ($^O =~ /win32/i) { } |
130
|
0 |
0 |
if ($arg =~ /[*?{}\[\]]/) { } |
143
|
0 |
0 |
$0 =~ /perlmv/ ? : |
|
0 |
0 |
$0 =~ /perlln/ ? : |
|
0 |
0 |
$0 =~ /perlln_s/ ? : |
|
0 |
0 |
$0 =~ /perlcp/ ? : |
150
|
0 |
0 |
if $self->{'dry_run'} |
153
|
0 |
0 |
if ($self->{'list'}) |
156
|
0 |
0 |
$self->{'verbose'} ? : |
164
|
0 |
0 |
if ($self->{'show'}) |
169
|
0 |
0 |
if ($self->{'write'}) |
171
|
0 |
0 |
unless @{$self->{'codes'};} and not ref $self->{'codes'}[0] |
176
|
0 |
0 |
if ($self->{'delete'}) |
181
|
0 |
0 |
unless (@{$self->{'codes'};}) |
183
|
0 |
0 |
unless $self->{'items'} |
188
|
0 |
0 |
if ref $_ eq "SCALAR" |
192
|
0 |
0 |
unless $self->{'items'} |
272
|
1 |
21 |
unless $self->{'scriptlets'}{$name} |
273
|
6 |
15 |
if (defined(my $mod = $self->{'scriptlets'}{$name}{'module'})) { } |
277
|
0 |
6 |
unless ${"${mod}::SCRIPTLET";} |
313
|
20 |
0 |
if (%App::perlmv::scriptlets::std::scriptlets) |
320
|
0 |
20 |
if (%App::perlmv::scriptlets::scriptlets) |
326
|
0 |
20 |
if (-d "/usr/share/perlmv/scriptlets") |
332
|
0 |
0 |
if $code |
337
|
2 |
18 |
if (-d "$self->{'homedir'}/.perlmv/scriptlets") |
344
|
1 |
0 |
if $code |
359
|
0 |
3 |
unless $self->valid_scriptlet_name($name) |
361
|
0 |
3 |
unless $code |
363
|
1 |
2 |
unless (-d $path) |
364
|
0 |
1 |
unless mkdir $path |
367
|
1 |
2 |
unless (-d $path) |
368
|
0 |
1 |
unless mkdir $path |
371
|
1 |
2 |
if (-e $path and not $self->{'overwrite'}) { } |
376
|
0 |
2 |
unless close $fh |
396
|
0 |
31 |
if $@ |
408
|
0 |
0 |
if (ref $code eq 'CODE') { } |
412
|
0 |
0 |
if $@ |
427
|
18 |
89 |
if (ref $code eq 'CODE') { } |
431
|
0 |
89 |
if $@ |
433
|
56 |
51 |
if (defined $res and length $res and $_ eq $orig_) |
439
|
31 |
1 |
$self->{'sort_mode'} == 1 ? : |
|
1 |
32 |
$self->{'sort_mode'} == -1 ? : |
449
|
0 |
107 |
if ($item->{'cwd'}) |
450
|
0 |
0 |
unless chdir $item->{'cwd'} |
452
|
0 |
107 |
if not $self->{'process_symlink'} and -l $item->{'real_name'} |
453
|
0 |
107 |
if (-d $item->{'real_name'}) |
454
|
0 |
0 |
unless $self->{'process_dir'} |
455
|
0 |
0 |
if ($self->{'recursive'}) |
457
|
0 |
0 |
if (chdir $item->{'real_name'}) { } |
459
|
0 |
0 |
if $self->{'verbose'} |
465
|
0 |
0 |
if $_ ne "." |
473
|
0 |
0 |
unless chdir $cwd |
488
|
449 |
0 |
ref $_ ? : |
494
|
0 |
107 |
unless defined $aold |
510
|
105 |
2 |
if -e $aold |
511
|
6 |
101 |
if $aold eq $anew |
514
|
9 |
92 |
unless ($code_is_final) |
520
|
83 |
9 |
if (not defined $self->{'mode'} or $self->{'mode'} =~ /^(rename|r)$/) { } |
|
0 |
9 |
elsif ($self->{'mode'} =~ /^(move|mv|m)$/) { } |
|
3 |
6 |
elsif ($self->{'mode'} =~ /^(copy|cp|c)$/) { } |
|
3 |
3 |
elsif ($self->{'mode'} =~ /^(symlink|sym|s)$/) { } |
|
3 |
0 |
elsif ($self->{'mode'} =~ /^(hardlink|h|link|l)$/) { } |
536
|
89 |
3 |
unless ($self->{'overwrite'}) |
539
|
14 |
89 |
if (-e $new or defined $anew and exists $self->{'_exists'}{$anew}) { } |
549
|
83 |
9 |
if $action eq "rename" or $action eq "move" |
550
|
3 |
89 |
if $self->{'dry_run'} |
553
|
5 |
87 |
if $self->{'verbose'} |
554
|
89 |
3 |
unless ($self->{'dry_run'}) |
557
|
1 |
88 |
if ($self->{'parents'}) |
559
|
1 |
0 |
unless (-e $dir) |
563
|
0 |
0 |
$file eq '' ? : |
566
|
0 |
1 |
if @$err |
571
|
0 |
89 |
if ($action eq 'move') { } |
|
80 |
9 |
elsif ($action eq 'rename') { } |
|
3 |
6 |
elsif ($action eq 'copy') { } |
|
3 |
3 |
elsif ($action eq 'symlink') { } |
|
3 |
0 |
elsif ($action eq 'link') { } |
573
|
0 |
0 |
unless $res |
576
|
1 |
79 |
unless $res |
579
|
0 |
3 |
unless $res |
583
|
0 |
3 |
unless $res |
586
|
0 |
3 |
unless $res |
588
|
1 |
88 |
unless $res |
596
|
0 |
0 |
unless $self->{'scriptlets'}{$name} |
599
|
0 |
0 |
$self->{'scriptlets'}{$name}{'code'} =~ /\n\z/ ? : |
605
|
33 |
0 |
if (@args) { } |
613
|
0 |
33 |
if ($self->{'_compiled'}) |
621
|
30 |
6 |
unless $self->{'compiled'} or ref $code eq "CODE" |
622
|
0 |
36 |
if $self->{'check'} |
624
|
3 |
33 |
if $i |