line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Goo::ShellCommander; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
############################################################################### |
6
|
|
|
|
|
|
|
# Nigel Hamilton |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Nigel Hamilton 2005 |
9
|
|
|
|
|
|
|
# All Rights Reserved |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# Author: Nigel Hamilton |
12
|
|
|
|
|
|
|
# Filename: Goo::ShellCommander.pm |
13
|
|
|
|
|
|
|
# Description: Run a command in the shell |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# Date Change |
16
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------- |
17
|
|
|
|
|
|
|
# 01/08/05 Factored out of ProgramEditor as part of the new Goo |
18
|
|
|
|
|
|
|
# |
19
|
|
|
|
|
|
|
############################################################################## |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
2697
|
use Goo::Object; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
22
|
1
|
|
|
1
|
|
5
|
use Goo::Prompter; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
25
|
|
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
7
|
use base qw(Goo::Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
129
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
############################################################################### |
28
|
|
|
|
|
|
|
# |
29
|
|
|
|
|
|
|
# run - keep adding a thing to the program |
30
|
|
|
|
|
|
|
# |
31
|
|
|
|
|
|
|
############################################################################### |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub run { |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
0
|
1
|
|
my ($this, $thing, $target) = @_; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $command = Goo::Prompter::ask("Enter a shell command>"); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
print `$command`; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
Goo::Prompter::notify("Command complete. Press a key to continue."); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 NAME |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Goo::ShellCommander - Run a command in the shell |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 SYNOPSIS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
use Goo::ShellCommander; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 DESCRIPTION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 METHODS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=over |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=item run |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
keep adding a Thing to the program |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=back |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Nigel Hamilton <nigel@trexy.com> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 SEE ALSO |