Skip to content

Commit

Permalink
add option to repair --all-bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
codon committed Jan 23, 2013
1 parent d6834dc commit 96fbca8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions repairman.pl
Expand Up @@ -14,13 +14,15 @@


my $config_name = "config.json"; my $config_name = "config.json";
my $body_name; my $body_name;
my $all_bodies = 0;
my $queue_name; my $queue_name;
my $debug = 0; my $debug = 0;
my $quiet_no_body = 0; my $quiet_no_body = 0;


GetOptions( GetOptions(
"config=s" => \$config_name, "config=s" => \$config_name,
"body=s" => \$body_name, "body=s" => \$body_name,
"all-bodies" => \$all_bodies,
"debug" => \$debug, "debug" => \$debug,
"quiet_no_body" => \$quiet_no_body, "quiet_no_body" => \$quiet_no_body,
) or die "$0 --config=foo.json --body=Bar\n"; ) or die "$0 --config=foo.json --body=Bar\n";
Expand All @@ -35,6 +37,9 @@
exit(1) unless $body_id || !$quiet_no_body; exit(1) unless $body_id || !$quiet_no_body;
die "No matching planet for name $body_name\n" unless $body_id; die "No matching planet for name $body_name\n" unless $body_id;
repair($body_id); repair($body_id);
} elsif($all_bodies) {
my $planets = $client->empire_status->{planets};
repair($_) for keys(%$planets);
} else { } else {
$body_id = $client->empire_status->{home_planet_id}; $body_id = $client->empire_status->{home_planet_id};
repair($body_id); repair($body_id);
Expand Down

0 comments on commit 96fbca8

Please sign in to comment.