line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- perl -*- |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Wizard - A Perl package for implementing system administration |
5
|
|
|
|
|
|
|
# applications in the style of Windows wizards. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# This module is |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# Copyright (C) 1999 Jochen Wiedmann |
11
|
|
|
|
|
|
|
# Am Eisteich 9 |
12
|
|
|
|
|
|
|
# 72555 Metzingen |
13
|
|
|
|
|
|
|
# Germany |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# Email: joe@ispsoft.de |
16
|
|
|
|
|
|
|
# Phone: +49 7123 14887 |
17
|
|
|
|
|
|
|
# |
18
|
|
|
|
|
|
|
# and Amarendran R. Subramanian |
19
|
|
|
|
|
|
|
# Grundstr. 32 |
20
|
|
|
|
|
|
|
# 72810 Gomaringen |
21
|
|
|
|
|
|
|
# Germany |
22
|
|
|
|
|
|
|
# |
23
|
|
|
|
|
|
|
# Email: amar@ispsoft.de |
24
|
|
|
|
|
|
|
# Phone: +49 7072 920696 |
25
|
|
|
|
|
|
|
# |
26
|
|
|
|
|
|
|
# All Rights Reserved. |
27
|
|
|
|
|
|
|
# |
28
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public |
29
|
|
|
|
|
|
|
# License or the Artistic License, as specified in the Perl README file. |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
5
|
use Wizard::Form (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
346
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
package Wizard::Form::Shell; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
@Wizard::Form::Shell::ISA = qw(Wizard::Form); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub Display { |
43
|
0
|
|
|
0
|
0
|
|
my($self, $wiz, $state) = @_; |
44
|
0
|
|
|
|
|
|
$self->{'options'} = {}; |
45
|
0
|
|
|
|
|
|
$wiz->ResetParam(); |
46
|
0
|
|
|
|
|
|
foreach my $elem (@{$self->{'elems'}}) { |
|
0
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
$elem->Display($wiz, $self, $state); |
48
|
|
|
|
|
|
|
} |
49
|
0
|
|
|
|
|
|
my $var; |
50
|
0
|
0
|
|
|
|
|
if (keys %{$self->{'options'}} == 1) { |
|
0
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
$var = (keys %{$self->{'options'}})[0]; |
|
0
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
} else { |
53
|
0
|
|
|
|
|
|
while (1) { |
54
|
0
|
|
|
|
|
|
print "\nSelect an option: "; |
55
|
0
|
|
|
|
|
|
$var = ; |
56
|
0
|
|
|
|
|
|
chomp $var; |
57
|
0
|
0
|
|
|
|
|
last if exists($self->{'options'}->{$var}); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
0
|
|
|
|
|
|
my $val = $self->{'options'}->{$var}; |
61
|
0
|
0
|
|
|
|
|
if (defined($val)) { |
62
|
0
|
|
|
|
|
|
$wiz->param($val, $var); |
63
|
|
|
|
|
|
|
} else { |
64
|
0
|
|
|
|
|
|
$state->Running(0); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub Option { |
69
|
0
|
|
|
0
|
0
|
|
my($self, $id, $action) = @_; |
70
|
0
|
|
|
|
|
|
$self->{'options'}->{$id} = $action; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
0
|
0
|
|
sub print { shift; print @_; } |
|
0
|
|
|
|
|
|
|
74
|
0
|
|
|
0
|
0
|
|
sub printf { shift; printf(@_); } |
|
0
|
|
|
|
|
|
|
75
|
0
|
|
|
0
|
0
|
|
sub readline { } |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |