Bug 10419: (follow-up) tidy names of command-line switches
[1] Use --library instead of --branchcode to be consistent with other scripts and user-facing Koha terminology. [2] Use --not_borrowed_since instead of --not_borrowered_since; no need to expose typos in the API to the user. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
b8a16ee2fc
commit
2a9c129d31
1 changed files with 10 additions and 10 deletions
|
@ -8,15 +8,15 @@ use Getopt::Long;
|
||||||
use C4::Members;
|
use C4::Members;
|
||||||
use Koha::DateUtils;
|
use Koha::DateUtils;
|
||||||
|
|
||||||
my ( $help, $verbose, $not_borrowered_since, $expired_before, $category_code,
|
my ( $help, $verbose, $not_borrowed_since, $expired_before, $category_code,
|
||||||
$branchcode, $confirm );
|
$branchcode, $confirm );
|
||||||
GetOptions(
|
GetOptions(
|
||||||
'h|help' => \$help,
|
'h|help' => \$help,
|
||||||
'v|verbose' => \$verbose,
|
'v|verbose' => \$verbose,
|
||||||
'not_borrowered_since:s' => \$not_borrowered_since,
|
'not_borrowed_since:s' => \$not_borrowed_since,
|
||||||
'expired_before:s' => \$expired_before,
|
'expired_before:s' => \$expired_before,
|
||||||
'category_code:s' => \$category_code,
|
'category_code:s' => \$category_code,
|
||||||
'branchcode:s' => \$branchcode,
|
'library:s' => \$branchcode,
|
||||||
'c|confirm' => \$confirm,
|
'c|confirm' => \$confirm,
|
||||||
) || pod2usage(1);
|
) || pod2usage(1);
|
||||||
|
|
||||||
|
@ -24,20 +24,20 @@ if ($help) {
|
||||||
pod2usage(1);
|
pod2usage(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$not_borrowered_since = dt_from_string( $not_borrowered_since, 'iso' )
|
$not_borrowed_since = dt_from_string( $not_borrowed_since, 'iso' )
|
||||||
if $not_borrowered_since;
|
if $not_borrowed_since;
|
||||||
|
|
||||||
$expired_before = dt_from_string( $expired_before, 'iso' )
|
$expired_before = dt_from_string( $expired_before, 'iso' )
|
||||||
if $expired_before;
|
if $expired_before;
|
||||||
|
|
||||||
unless ( $not_borrowered_since or $expired_before or $category_code or $branchcode ) {
|
unless ( $not_borrowed_since or $expired_before or $category_code or $branchcode ) {
|
||||||
pod2usage(q{At least one filter is mandatory});
|
pod2usage(q{At least one filter is mandatory});
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $members = GetBorrowersToExpunge(
|
my $members = GetBorrowersToExpunge(
|
||||||
{
|
{
|
||||||
not_borrowered_since => $not_borrowered_since,
|
not_borrowered_since => $not_borrowed_since,
|
||||||
expired_before => $expired_before,
|
expired_before => $expired_before,
|
||||||
category_code => $category_code,
|
category_code => $category_code,
|
||||||
branchcode => $branchcode,
|
branchcode => $branchcode,
|
||||||
|
@ -74,7 +74,7 @@ delete_patrons - This script deletes patrons
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
delete_patrons.pl [-h -v -c] --not_borrowered_since=2013-07-21 --expired_before=2013-07-21 --category_code=CAT --branchcode=CPL
|
delete_patrons.pl [-h -v -c] --not_borrowed_since=2013-07-21 --expired_before=2013-07-21 --category_code=CAT --branchcode=CPL
|
||||||
|
|
||||||
dates can be generated with `date -d '-3 month' "+%Y-%m-%d"`
|
dates can be generated with `date -d '-3 month' "+%Y-%m-%d"`
|
||||||
|
|
||||||
|
@ -88,9 +88,9 @@ Options are cumulatives.
|
||||||
|
|
||||||
Print a brief help message
|
Print a brief help message
|
||||||
|
|
||||||
=item B<--not_borrowered_since>
|
=item B<--not_borrowed_since>
|
||||||
|
|
||||||
Delete patrons who have not borrowered since this date.
|
Delete patrons who have not borrowed since this date.
|
||||||
|
|
||||||
=item B<--expired_date>
|
=item B<--expired_date>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue