line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Simple.pm,v 1.5 2007/07/13 00:00:14 ask Exp $ |
2
|
|
|
|
|
|
|
# $Source: /opt/CVS/Getopt-LL/lib/Getopt/LL/Simple.pm,v $ |
3
|
|
|
|
|
|
|
# $Author: ask $ |
4
|
|
|
|
|
|
|
# $HeadURL$ |
5
|
|
|
|
|
|
|
# $Revision: 1.5 $ |
6
|
|
|
|
|
|
|
# $Date: 2007/07/13 00:00:14 $ |
7
|
|
|
|
|
|
|
package Getopt::LL::Simple; |
8
|
3
|
|
|
3
|
|
85757
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
90
|
|
9
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
86
|
|
10
|
3
|
|
|
3
|
|
1151
|
use Getopt::LL::Short qw(getoptions); |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
22
|
|
11
|
3
|
|
|
3
|
|
18
|
use version; our $VERSION = qv('1.0.0'); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
11
|
|
12
|
3
|
|
|
3
|
|
245
|
use 5.006_001; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
314
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import { |
15
|
3
|
|
|
3
|
|
30
|
my ($pkg, @rules) = @_; |
16
|
3
|
|
|
|
|
9
|
my $caller = caller; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
5
|
my $options_ref; |
19
|
3
|
100
|
100
|
|
|
27
|
if (scalar @rules && ref $rules[-1] eq 'HASH') { |
20
|
1
|
|
|
|
|
3
|
$options_ref = pop @rules; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
31
|
my $options |
24
|
|
|
|
|
|
|
= getoptions(\@rules, $options_ref); |
25
|
|
|
|
|
|
|
|
26
|
3
|
|
|
3
|
|
18
|
no strict 'refs'; ## no critic |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
229
|
|
27
|
3
|
|
|
|
|
29
|
%{ $caller . q{::} . 'ARGV' } = %{ $options }; |
|
3
|
|
|
|
|
21
|
|
|
3
|
|
|
|
|
23
|
|
28
|
|
|
|
|
|
|
|
29
|
3
|
|
|
|
|
396441
|
return; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
__END__ |