Bug 7326: longoverdue.pl hardcoded to 366 days maximum

Adds --maxdays command line flag to longoverdue.pl to allow the user to specify
their own $endrange value.  Because sometimes 366 isn't enough!

Also adds help documentation for both --quiet and --maxdays params

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Simple change, works well

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 1f5f4981c0)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
(cherry picked from commit 5133a9df21)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
Ian Walls 2011-12-06 19:12:04 -05:00 committed by Chris Nighswonger
parent c51d8a474b
commit f6dc5ad89b
1 changed files with 7 additions and 1 deletions

View File

@ -39,7 +39,7 @@ use Getopt::Long;
my $lost; # key=lost value, value=num days.
my ($charge, $verbose, $confirm, $quiet);
my $endrange = 366; # FIXME hardcoded - don't deal with anything overdue by more than this num days.
my $endrange = 366;
GetOptions(
'lost=s%' => \$lost,
@ -47,6 +47,7 @@ GetOptions(
'confirm' => \$confirm,
'verbose' => \$verbose,
'quiet' => \$quiet,
'maxdays=s' => \$endrange
);
my $usage = << 'ENDUSAGE';
@ -68,6 +69,11 @@ This script takes the following parameters :
--confirm confirm. without this option, the script will report the number of affected items and
return without modifying any records.
--quiet suppress summary output.
--maxdays Specifies the end of the range of overdue days to deal with (defaults to 366). This
value is universal to all lost num days overdue passed.
examples :
$PERL5LIB/misc/cronjobs/longoverdue.pl --lost 30=1
Would set LOST=1 after 30 days (up to one year), but not charge the account.