line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/env perl |
2
|
|
|
|
|
|
|
package |
3
|
|
|
|
|
|
|
mvr; |
4
|
11
|
|
|
11
|
|
201
|
use v5.14.0; |
|
11
|
|
|
|
|
30
|
|
|
11
|
|
|
|
|
606
|
|
5
|
11
|
|
|
11
|
|
55
|
use strict; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
315
|
|
6
|
11
|
|
|
11
|
|
52
|
use warnings; |
|
11
|
|
|
|
|
15
|
|
|
11
|
|
|
|
|
583
|
|
7
|
11
|
|
|
|
|
42
|
our $VERSION = '0.005'; # VERSION |
8
|
|
|
|
|
|
|
# PODNAME: mvr |
9
|
|
|
|
|
|
|
# ABSTRACT: like mv, but clever |
10
|
|
|
|
|
|
|
|
11
|
11
|
|
|
11
|
|
13763
|
use Pod::Usage qw(pod2usage); |
|
11
|
|
|
|
|
923134
|
|
|
11
|
|
|
|
|
1258
|
|
12
|
11
|
|
|
11
|
|
25881
|
use Getopt::Long; |
|
11
|
|
|
|
|
189047
|
|
|
11
|
|
|
|
|
77
|
|
13
|
11
|
|
|
11
|
|
9375
|
use App::mvr; |
|
11
|
|
|
|
|
45
|
|
|
11
|
|
|
|
|
23993
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
11
|
|
|
|
|
35
|
my $verbose = 1; |
17
|
11
|
|
|
1
|
|
148
|
my %opts = ( quiet => sub { $verbose = 0 }, verbose => \$verbose, deduplicate => 1 ); |
|
1
|
|
|
|
|
700
|
|
18
|
11
|
50
|
|
|
|
88
|
GetOptions( \%opts, |
19
|
|
|
|
|
|
|
'help|?', |
20
|
|
|
|
|
|
|
'version', |
21
|
|
|
|
|
|
|
'verbose|v+', |
22
|
|
|
|
|
|
|
'quiet!', |
23
|
|
|
|
|
|
|
'deduplicate!', |
24
|
|
|
|
|
|
|
) or pod2usage( -verbose => 1 ); |
25
|
11
|
50
|
|
|
|
5765
|
pod2usage( -verbose => 2 ) if $opts{help}; |
26
|
|
|
|
|
|
|
|
27
|
11
|
100
|
|
|
|
74
|
if ($opts{version}) { |
28
|
1
|
|
50
|
|
|
50
|
say __PACKAGE__ . ' version ' . (__PACKAGE__->VERSION // 'dev'); |
29
|
1
|
|
|
|
|
0
|
exit; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
10
|
|
|
|
|
36
|
my @source; |
33
|
10
|
|
|
|
|
74
|
push @source, shift |
34
|
|
|
|
|
|
|
while @ARGV > 1; |
35
|
10
|
50
|
|
|
|
43
|
pod2usage( -verbose => 0, -exitval => 1) unless @ARGV; |
36
|
|
|
|
|
|
|
|
37
|
10
|
|
|
|
|
26
|
my $dest = shift; |
38
|
|
|
|
|
|
|
|
39
|
10
|
|
|
|
|
55
|
local $App::mvr::VERBOSE = $verbose; |
40
|
10
|
|
|
|
|
353
|
mvr( source => \@source, dest => $dest, deduplicate => $opts{deduplicate} ); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |