diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-04-03 10:57:24 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-04-06 15:39:29 +0100 |
commit | 99043455d12b3d7952d21bff0538539a9601ebf0 (patch) | |
tree | e84c543be6ec038e162da1db28bda5a0ff046448 /bin | |
parent | 836201a3e6b4a54256ac63716eecad982b9abd65 (diff) |
Tidy up verbose/debug handling of send-reports.
Use verbose for all log output, and debug only for
overriding the should_skip check.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/send-reports | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/send-reports b/bin/send-reports index 81be691e7..9651c271c 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -17,6 +17,7 @@ BEGIN { require "$d/../setenv.pl"; } +use Getopt::Long::Descriptive; use CronFns; use FixMyStreet; @@ -25,4 +26,13 @@ use FixMyStreet::Script::Reports; my $site = CronFns::site(FixMyStreet->config('BASE_URL')); CronFns::language($site); -FixMyStreet::Script::Reports::send(); +my ($opts, $usage) = describe_options( + '%c %o', + ['verbose|v', 'more verbose output'], + ['nomail', 'do not send any email, print instead'], + ['debug', 'always try and send reports (no back-off skipping)'], + ['help|h', "print usage message and exit" ], +); +$usage->die if $opts->help; + +FixMyStreet::Script::Reports::send($opts->verbose, $opts->nomail, $opts->debug); |