line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
require 5;
|
3
|
|
|
|
|
|
|
package Getopt::Janus;
|
4
|
8
|
|
|
8
|
|
47195
|
use strict;
|
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
1400
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter;
|
7
|
|
|
|
|
|
|
# TODO: progress meters?
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN {
|
10
|
8
|
50
|
50
|
8
|
|
105
|
if(defined &DEBUG) {
|
|
|
50
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# no-op
|
12
|
|
|
|
|
|
|
} elsif( ($ENV{'JANUSDEBUG'} || '') =~ m/^(-?\d+)$/s) {
|
13
|
0
|
|
|
|
|
0
|
eval "sub DEBUG () {$1}";
|
14
|
0
|
0
|
|
|
|
0
|
die "INSANE! $@" if $@;
|
15
|
|
|
|
|
|
|
} else {
|
16
|
8
|
|
|
|
|
227
|
*DEBUG = sub () {0};
|
17
|
|
|
|
|
|
|
}
|
18
|
|
|
|
|
|
|
}
|
19
|
|
|
|
|
|
|
|
20
|
8
|
|
|
|
|
5834
|
use vars qw(@ISA %EXPORT_TAGS @EXPORT $VERSION
|
21
|
|
|
|
|
|
|
@New_files $Facade_class $facade_obj
|
22
|
8
|
|
|
8
|
|
48
|
);
|
|
8
|
|
|
|
|
28
|
|
23
|
|
|
|
|
|
|
@ISA = ('Exporter');
|
24
|
|
|
|
|
|
|
%EXPORT_TAGS = ('ALL' => \@EXPORT);
|
25
|
|
|
|
|
|
|
$VERSION = '1.03';
|
26
|
|
|
|
|
|
|
@EXPORT = qw{
|
27
|
|
|
|
|
|
|
yes_no string file new_file choose
|
28
|
|
|
|
|
|
|
license_artistic license_gnu license_either
|
29
|
|
|
|
|
|
|
licence_artistic licence_gnu licence_either
|
30
|
|
|
|
|
|
|
run
|
31
|
|
|
|
|
|
|
note_new_files note_new_file
|
32
|
|
|
|
|
|
|
};
|
33
|
|
|
|
|
|
|
$Facade_class ||= __PACKAGE__ . '::Facade';
|
34
|
|
|
|
|
|
|
DEBUG and print "Facade class: $Facade_class\n";
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
37
|
2
|
|
|
2
|
1
|
340
|
sub run ($@) { _self()-> run(@_) }
|
38
|
|
|
|
|
|
|
|
39
|
2
|
|
|
2
|
1
|
790
|
sub string (\$$@) { _self()-> string(@_) }
|
40
|
2
|
|
|
2
|
1
|
354
|
sub new_file (\$$@) { _self()->new_file(@_) }
|
41
|
2
|
|
|
2
|
1
|
378
|
sub file (\$$@) { _self()-> file(@_) }
|
42
|
2
|
|
|
2
|
1
|
1310
|
sub yes_no (\$$@) { _self()-> yes_no(@_) }
|
43
|
4
|
|
|
4
|
1
|
664
|
sub choose (\$$@) { _self()-> choose(@_) }
|
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
0
|
1
|
0
|
sub license_artistic () { _self()->license_artistic(@_) }
|
46
|
0
|
|
|
0
|
1
|
0
|
sub license_gnu () { _self()->license_gnu(@_) }
|
47
|
2
|
|
|
2
|
1
|
356
|
sub license_either () { _self()->license_either(@_) }
|
48
|
|
|
|
|
|
|
# variant spelling:
|
49
|
0
|
|
|
0
|
0
|
0
|
sub licence_artistic () { _self()->license_artistic(@_) }
|
50
|
0
|
|
|
0
|
0
|
0
|
sub licence_gnu () { _self()->license_gnu(@_) }
|
51
|
0
|
|
|
0
|
0
|
0
|
sub licence_either () { _self()->license_either(@_) }
|
52
|
|
|
|
|
|
|
|
53
|
2
|
|
|
2
|
0
|
8
|
sub note_new_file { push @New_files, @_; }
|
54
|
2
|
|
|
2
|
1
|
423
|
sub note_new_files { goto ¬e_new_file; } # alias
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _self { # This is the only place where we construct
|
59
|
16
|
|
50
|
16
|
|
169
|
return $facade_obj ||=
|
|
|
|
66
|
|
|
|
|
60
|
|
|
|
|
|
|
( _require($Facade_class) || die "Can't load $Facade_class: $@"
|
61
|
|
|
|
|
|
|
)->new()
|
62
|
|
|
|
|
|
|
}
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub _require { # returns classname if loadable, or nil if not
|
65
|
4
|
|
|
4
|
|
10
|
my $class = $_[0];
|
66
|
4
|
50
|
33
|
|
|
41
|
unless( defined $class and length $class ) {
|
67
|
0
|
|
|
|
|
0
|
require Carp;
|
68
|
0
|
|
|
|
|
0
|
Carp::confess( "What class?" );
|
69
|
|
|
|
|
|
|
}
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
{
|
72
|
8
|
|
|
8
|
|
50
|
no strict 'refs';
|
|
8
|
|
|
|
|
20
|
|
|
8
|
|
|
|
|
1194
|
|
|
4
|
|
|
|
|
6
|
|
73
|
4
|
50
|
33
|
|
|
7
|
unless( # unless it's already loaded...
|
|
|
|
33
|
|
|
|
|
74
|
4
|
|
|
|
|
30
|
defined( ${"$class\::VERSION"} )
|
|
4
|
|
|
|
|
53
|
|
75
|
4
|
|
|
|
|
33
|
or @{"$class\::ISA"}
|
76
|
|
|
|
|
|
|
or defined &{"$class\::new"}
|
77
|
|
|
|
|
|
|
) {
|
78
|
4
|
|
|
|
|
290
|
eval "require $class";
|
79
|
4
|
50
|
|
|
|
27
|
return if $@;
|
80
|
4
|
|
|
|
|
8
|
DEBUG and print "Loaded $class fine.\n";
|
81
|
|
|
|
|
|
|
}
|
82
|
|
|
|
|
|
|
}
|
83
|
4
|
|
|
|
|
49
|
return $class;
|
84
|
|
|
|
|
|
|
}
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1;
|
90
|
|
|
|
|
|
|
__END__
|