aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-10-30 17:17:39 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-01-09 10:15:46 +0000
commitc4961f186e1bf5b9f14fa51e99c37bc013dd8e37 (patch)
treee2d91e09dfbe123a011aa2a9d689e494b11d3603
parentf18c871b126342c7ca1ab3f6f994fb32fcf0f1d8 (diff)
Add body argument to Open311 populate script.
-rwxr-xr-xbin/open311-populate-service-list7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/open311-populate-service-list b/bin/open311-populate-service-list
index 9c05055c6..d81df9321 100755
--- a/bin/open311-populate-service-list
+++ b/bin/open311-populate-service-list
@@ -16,17 +16,22 @@ use Getopt::Long::Descriptive;
my ($opt, $usage) = describe_options(
'%c %o',
+ ['body|b:s', "body name to only fetch this body"],
['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;
+$usage->die if $opt->help;
my $bodies = FixMyStreet::DB->resultset('Body')->search( {
# Until Oxfordshire does
name => { -not_in => [ 'Oxfordshire County Council' ] },
send_method => 'Open311'
} );
+if ($opt->body) {
+ $bodies = $bodies->search({ name => $opt->body });
+}
+
my $verbose = 0;
$verbose = 1 if $opt->warn;
$verbose = 2 if $opt->verbose;