line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Format::PerlMF_App; |
2
|
|
|
|
|
|
|
$Module::Format::PerlMF_App::VERSION = '0.0.8'; |
3
|
1
|
|
|
1
|
|
77363
|
use strict; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
760
|
use Getopt::Long qw(GetOptionsFromArray); |
|
1
|
|
|
|
|
14509
|
|
|
1
|
|
|
|
|
7
|
|
7
|
1
|
|
|
1
|
|
767
|
use Pod::Usage; |
|
1
|
|
|
|
|
56779
|
|
|
1
|
|
|
|
|
149
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
554
|
use Module::Format::ModuleList; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
503
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new |
13
|
|
|
|
|
|
|
{ |
14
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
15
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
16
|
0
|
|
|
|
|
|
$self->_init(@_); |
17
|
0
|
|
|
|
|
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _argv |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
0
|
|
|
my $self = shift; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
if (@_) |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
|
|
|
$self->{_argv} = shift; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
return $self->{_argv}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _init |
33
|
|
|
|
|
|
|
{ |
34
|
0
|
|
|
0
|
|
|
my ( $self, $args ) = @_; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$self->_argv( [ @{ $args->{argv} } ] ); |
|
0
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my %ops_to_formats = ( |
43
|
|
|
|
|
|
|
'as_rpm_colon' => 'rpm_colon', |
44
|
|
|
|
|
|
|
'rpm_colon' => 'rpm_colon', |
45
|
|
|
|
|
|
|
'as_rpm_c' => 'rpm_colon', |
46
|
|
|
|
|
|
|
'rpm_c' => 'rpm_colon', |
47
|
|
|
|
|
|
|
'as_rpm_dash' => 'rpm_dash', |
48
|
|
|
|
|
|
|
'rpm_dash' => 'rpm_dash', |
49
|
|
|
|
|
|
|
'as_rpm_d' => 'rpm_dash', |
50
|
|
|
|
|
|
|
'rpm_d' => 'rpm_dash', |
51
|
|
|
|
|
|
|
'dash' => 'dash', |
52
|
|
|
|
|
|
|
'as_dash' => 'dash', |
53
|
|
|
|
|
|
|
'colon' => 'colon', |
54
|
|
|
|
|
|
|
'as_colon' => 'colon', |
55
|
|
|
|
|
|
|
'deb' => 'debian', |
56
|
|
|
|
|
|
|
'as_deb' => 'debian', |
57
|
|
|
|
|
|
|
'debian' => 'debian', |
58
|
|
|
|
|
|
|
'as_debian' => 'debian', |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub run |
62
|
|
|
|
|
|
|
{ |
63
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
my $argv = $self->_argv(); |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
my $op = shift(@$argv); |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
if ( !defined($op) ) |
70
|
|
|
|
|
|
|
{ |
71
|
0
|
|
|
|
|
|
die "You did not specify any arguments - see --help"; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
0
|
0
|
0
|
|
|
|
if ( ( $op eq "-h" ) || ( $op eq "--help" ) ) |
|
|
0
|
|
|
|
|
|
75
|
|
|
|
|
|
|
{ |
76
|
0
|
|
|
|
|
|
pod2usage(1); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
elsif ( $op eq "--man" ) |
79
|
|
|
|
|
|
|
{ |
80
|
0
|
|
|
|
|
|
pod2usage( -verbose => 2 ); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
0
|
0
|
|
|
|
|
if ( !exists( $ops_to_formats{$op} ) ) |
84
|
|
|
|
|
|
|
{ |
85
|
0
|
|
|
|
|
|
die "Unknown op '$op'."; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
my $format = $ops_to_formats{$op}; |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
|
|
|
my $delim = ' '; |
91
|
0
|
|
|
|
|
|
my $suffix = "\n"; |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
my $help = 0; |
94
|
0
|
|
|
|
|
|
my $man = 0; |
95
|
0
|
0
|
|
|
|
|
if ( |
96
|
|
|
|
|
|
|
!( |
97
|
|
|
|
|
|
|
my $ret = GetOptionsFromArray( |
98
|
|
|
|
|
|
|
$argv, |
99
|
0
|
|
|
0
|
|
|
'0!' => sub { $delim = "\0"; $suffix = q{}; }, |
|
0
|
|
|
|
|
|
|
100
|
0
|
|
|
0
|
|
|
'n!' => sub { $delim = "\n"; $suffix = "\n"; }, |
|
0
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
'help|h' => \$help, |
102
|
|
|
|
|
|
|
man => \$man, |
103
|
|
|
|
|
|
|
) |
104
|
|
|
|
|
|
|
) |
105
|
|
|
|
|
|
|
) |
106
|
|
|
|
|
|
|
{ |
107
|
0
|
|
|
|
|
|
die "GetOptions failed!"; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
0
|
0
|
|
|
|
|
if ($help) |
111
|
|
|
|
|
|
|
{ |
112
|
0
|
|
|
|
|
|
pod2usage(1); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
0
|
0
|
|
|
|
|
if ($man) |
116
|
|
|
|
|
|
|
{ |
117
|
0
|
|
|
|
|
|
pod2usage( -verbose => 2 ); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
0
|
|
|
|
|
|
my @strings = @$argv; |
121
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
my $module_list_obj = Module::Format::ModuleList->sane_from_guesses( |
123
|
|
|
|
|
|
|
{ |
124
|
|
|
|
|
|
|
values => \@strings, |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
); |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
|
print join( $delim, @{ $module_list_obj->format_as($format) } ), $suffix; |
|
0
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
|
return; |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
1; # End of Module::Format::PerlMF_App |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
__END__ |