diff --git a/CHANGELOG.md b/CHANGELOG.md index ba93a3ac3b..60b2dc9e4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ - Cobrands can provide per-category custom distances for duplicate lookup. #4746 #5162 - Add perl 5.38 support. - Add plain text template previews to /_dev/email. #5105 + - Add --exclude option to bin/open311-populate-service-list - Performance improvements: - Reduce database queries on shortlist page. - Provide ResultSet fallback translation in lookup. diff --git a/bin/open311-populate-service-list b/bin/open311-populate-service-list index 966b3ac734..88d2570c9b 100755 --- a/bin/open311-populate-service-list +++ b/bin/open311-populate-service-list @@ -17,6 +17,7 @@ use Getopt::Long::Descriptive; my ($opt, $usage) = describe_options( '%c %o', ['body|b:s', "body name to only fetch this body"], + ['exclude|e:s@', 'body name(s) to exclude from fetching' ], ['verbose|v', "print out all services as they are found"], ['warn|w', "output warnings about any issues"], ['help', "print usage message and exit" ], @@ -29,6 +30,9 @@ my $bodies = FixMyStreet::DB->resultset('Body')->search( { if ($opt->body) { $bodies = $bodies->search({ name => $opt->body }); } +if (my $exclude = $opt->exclude) { + $bodies = $bodies->search({ name => { -not_in => $exclude } }); +} my $verbose = 0; $verbose = 1 if $opt->warn;