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|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
303
|
|
|
1
|
|
|
|
|
1659
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
253
|
|
|
1
|
|
|
|
|
1535
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
368
|
|
|
1
|
|
|
|
|
1693
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
231
|
|
|
1
|
|
|
|
|
1868
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
279
|
|
|
1
|
|
|
|
|
1693
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
233
|
|
|
1
|
|
|
|
|
2161
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
252
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# The import method is pretty basic, it just chops up the @ARGV array and parses |
9
|
|
|
|
|
|
|
# out anything that looks like an argument and makes it a key-value pair in the |
10
|
|
|
|
|
|
|
# %ARGV hash. The basic flow is: |
11
|
|
|
|
|
|
|
# 1) if there aren't double-dashes at the start of an argument, consider the |
12
|
|
|
|
|
|
|
# argument a bareword and go to the next argument |
13
|
|
|
|
|
|
|
# 2) split the key/value pair on the first equal sign |
14
|
|
|
|
|
|
|
# 3) if there isn't a key, we were passed only double-dashes so stop processing |
15
|
|
|
|
|
|
|
# 4) Add the flag or key/value pair to the %ARGV hash |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
3
|
|
|
3
|
|
1357
|
my %flags; |
19
|
|
|
|
|
|
|
my %values; |
20
|
1
|
|
|
|
|
4
|
my @barewords; |
21
|
3
|
|
|
|
|
108
|
while ( my $arg = shift @ARGV ) { |
22
|
|
|
|
|
|
|
|
23
|
6
|
100
|
|
|
|
19
|
if ( substr( $arg, 0, 2 ) ne q{--} ) { |
24
|
3
|
|
|
|
|
5
|
push @barewords, $arg; |
25
|
3
|
|
|
|
|
229
|
next; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
4
|
|
|
|
|
1603
|
my ( $key, $value ) = split /=/xms, substr( $arg, 2 ), 2; |
29
|
|
|
|
|
|
|
|
30
|
4
|
100
|
66
|
|
|
18
|
last unless ( defined $key ) or ( defined $value ); |
31
|
|
|
|
|
|
|
|
32
|
3
|
100
|
|
|
|
31
|
if ( defined $value ) { |
33
|
2
|
50
|
|
|
|
9
|
if ( exists $values{$key} ) { |
34
|
1
|
0
|
|
|
|
1
|
if ( not ref $values{$key} ) { |
35
|
1
|
|
|
|
|
194
|
$values{$key} = [ $values{$key} ]; |
36
|
|
|
|
|
|
|
} |
37
|
1
|
|
|
|
|
1287
|
push @{ $values{$key} }, $value; |
|
1
|
|
|
|
|
2
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
else { |
40
|
2
|
|
|
|
|
30
|
$values{$key} = $value; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
else { |
44
|
2
|
|
|
|
|
8
|
$flags{$key} = 1; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
3
|
|
|
|
|
10
|
%ARGV = ( %flags, %values ); |
49
|
3
|
|
|
|
|
199
|
unshift @ARGV, @barewords; |
50
|
|
|
|
|
|
|
|
51
|
3
|
|
|
|
|
1411
|
return; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |