Line 112... |
Line 112... |
112 |
'target|t=s',
|
112 |
'target|t=s',
|
113 |
'verbose|v+',# integer, can be incremented like -vv
|
113 |
'verbose|v+',# integer, can be incremented like -vv
|
114 |
'version|V' # note, the short form is a capital 'V'
|
114 |
'version|V' # note, the short form is a capital 'V'
|
115 |
) or die "Error parsing command line\n";
|
115 |
) or die "Error parsing command line\n";
|
116 |
|
116 |
|
117 |
die Dumper( $config );
|
117 |
print "Parameters are " . Dumper( $config ) . "\n" if $config->{'flags'}->{'debug'};
|
118 |
|
- |
|
119 |
#$config->{'flags'}->{'debug'} = 2;
|
118 |
die if $config->{'flags'}->{'debug'} > 3;
|
120 |
#die Dumper( &getAvailableResources( 'dd-103' ) ) . "\n";
|
- |
|
121 |
|
119 |
|
122 |
my $command = shift; # the first one is the actual subsection
|
120 |
my $command = shift; # the first one is the actual subsection
|
123 |
my $action = shift; # second is action to run
|
121 |
my $action = shift; # second is action to run
|
124 |
$action = 'help' unless $action;
|
122 |
$action = 'help' unless $action;
|
125 |
|
123 |
|
126 |
if ( $config->{'flags'}->{'help'} || $command eq 'help' || ! $command ) { &help() ; exit; }
|
124 |
if ( $config->{'flags'}->{'help'} || $command eq 'help' || ! $command ) { &help() ; exit; }
|
127 |
if ( $config->{'flags'}->{'version'} ) { use File::Basename; print basename($0) . " v$VERSION\n"; exit; }
|
125 |
if ( $config->{'flags'}->{'version'} ) { use File::Basename; print basename($0) . " v$VERSION\n"; exit; }
|
128 |
|
126 |
|
129 |
|
- |
|
130 |
print "Parameters are " . Dumper( $config ) . "\n" if $config->{'flags'}->{'debug'};
|
- |
|
131 |
print "Command = $command\nAction = $action\n" if $config->{'flags'}->{'debug'};
|
127 |
print "Command = $command\nAction = $action\n" if $config->{'flags'}->{'debug'};
|
132 |
|
128 |
|
133 |
die;
|
- |
|
134 |
|
129 |
|
135 |
# we allow a three part command for some actions on a domain, ie start, shutdown, migrate and destroy
|
130 |
# we allow a three part command for some actions on a domain, ie start, shutdown, migrate and destroy
|
136 |
# for simplicity, if the command is one of the above, allow the user to enter like that, but we will
|
131 |
# for simplicity, if the command is one of the above, allow the user to enter like that, but we will
|
137 |
# restructure the command as if they had used the full, three part (ie, with domain as the command)
|
132 |
# restructure the command as if they had used the full, three part (ie, with domain as the command)
|
138 |
# so, the following are equivilent
|
133 |
# so, the following are equivilent
|