aboutsummaryrefslogtreecommitdiffstats
path: root/bin/open311-populate-service-list
blob: 392b86dbd779dd0ca77c0ef752ffa6970dd49f07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl

use strict;
use warnings;
use FixMyStreet::App;
use Open311::PopulateServiceList;
use Getopt::Long::Descriptive;

my ($opt, $usage) = describe_options(
    '%c %o',
    ['verbose|v',  "print out all services as they are found"],
    ['warn|w',     "output warnings about any issues"],
    ['help',       "print usage message and exit" ],
);
print($usage->text), exit if $opt->help;

my $council_list = FixMyStreet::App->model('DB::Open311conf')->search( {
    send_method => 'Open311'
} );
my $verbose = 0;
$verbose = 1 if $opt->warn;
$verbose = 2 if $opt->verbose;
my $p = Open311::PopulateServiceList->new( council_list => $council_list, verbose => $verbose );

$p->process_councils;