line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
require 5; |
3
|
|
|
|
|
|
|
package Getopt::Janus::Facade; |
4
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
102
|
|
5
|
|
|
|
|
|
|
require Getopt::Janus; # for its _require sub |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
12
|
use vars qw(@GUI_classes @CLI_classes); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
657
|
|
8
|
|
|
|
|
|
|
push @GUI_classes, 'Getopt::Janus::Tk'; |
9
|
|
|
|
|
|
|
push @CLI_classes, 'Getopt::Janus::CLI'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
2
|
|
|
2
|
0
|
4
|
my $class = shift; |
13
|
2
|
50
|
|
|
|
7
|
die "$class subclasses " . __PACKAGE__ . "?!?!" |
14
|
|
|
|
|
|
|
unless $class eq __PACKAGE__; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
4
|
my @errors; |
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
|
|
4
|
Load: |
19
|
|
|
|
|
|
|
{ |
20
|
2
|
|
|
|
|
3
|
my $trial_classes; |
21
|
2
|
50
|
|
|
|
8
|
$trial_classes = @ARGV ? \@CLI_classes : \@GUI_classes; |
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
4
|
foreach my $trial_class (@$trial_classes) { |
24
|
2
|
50
|
|
|
|
6
|
return $trial_class->new if Getopt::Janus::_require($trial_class); |
25
|
0
|
|
|
|
|
|
push @errors, $@; |
26
|
0
|
|
|
|
|
|
$errors[-1] =~ s/\n*$/\n/s; |
27
|
|
|
|
|
|
|
} |
28
|
0
|
0
|
|
|
|
|
if(! @ARGV) { |
29
|
|
|
|
|
|
|
# We had no args but couldn't load a GUI class. Just emit |
30
|
|
|
|
|
|
|
# a help message and quit. |
31
|
0
|
|
|
|
|
|
@ARGV = '-h'; |
32
|
0
|
|
|
|
|
|
redo Load; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Otherwise we couldn't manage anything: |
37
|
0
|
|
|
|
|
|
die join '', |
38
|
|
|
|
|
|
|
__PACKAGE__, " couldn't load any interface classes:\n", |
39
|
|
|
|
|
|
|
@errors, "Aborting"; |
40
|
|
|
|
|
|
|
; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
__END__ |