Skip to content

Commit

Permalink
Fix -v option to bin/address_lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Mar 28, 2024
1 parent 0dea8a2 commit bc220e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/address_lookup
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ if(scalar(@ARGV) == 0) {

my %opts;
getopts('v', \%opts);
Geo::Coder::Free::DB::init(logger => MyLogger->new()) if($opts{'v'});
Database::Abstraction::init(logger => MyLogger->new()) if($opts{'v'});

# print join(' ', @ARGV), "\n";
if(my $rc = Geo::Coder::Free::Local::geocode(join(' ', @ARGV))) {
print 'Local: ', Data::Dumper->new([$rc])->Dump();
} elsif($rc = Geo::Coder::Free::geocode(join(' ', @ARGV))) {
# if(my $rc = Geo::Coder::Free::geocode(join(' ', @ARGV))) {
print Data::Dumper->new([$rc])->Dump();
} elsif($ENV{'OPENADDR_HOME'} && ($rc = Geo::Coder::Free::OpenAddresses->new(openaddr => $ENV{'OPENADDR_HOME'})->geocode(location => join(' ', @ARGV)))) {
print Data::Dumper->new([$rc])->Dump();
} else {
print STDERR join(' ', @ARGV), ": not found\n" if($opts{'v'});
exit(1);
}

Expand Down

0 comments on commit bc220e8

Please sign in to comment.