aboutsummaryrefslogtreecommitdiffstats
path: root/bin/oxfordshire/archive-old-enquiries
blob: 7fe66703abb60579c3904dc0da8c63120601092a (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
26
27
28
29
#!/usr/bin/env perl

use strict;
use warnings;
require 5.8.0;

BEGIN {
    use File::Basename qw(dirname);
    use File::Spec;
    my $d = dirname(File::Spec->rel2abs($0));
    require "$d/../../setenv.pl";
}

use FixMyStreet::Script::ArchiveOldEnquiries;
use Getopt::Long::Descriptive;

my ($opts, $usage) = describe_options(
    '%c %o',
    ['commit|c',     "actually close reports and send emails. Omitting this flag will do a dry-run"],
    ['body|b=s',     "which body ID to close reports for"],
    ['cobrand=s',     "which cobrand template to use for sent emails"],
    ['closure-cutoff=s',     "Anything before this will be closed with no email"],
    ['email-cutoff=s',     "Anything before this will be closed with an email sent to the reporter"],
    ['limit|l=s',     "limit to a certain number of reports/users to be closed"],
    ['help|h',       "print usage message and exit" ],
);
print($usage->text), exit if $opts->help;

FixMyStreet::Script::ArchiveOldEnquiries::archive($opts);