|
Lines 36-41
use C4::Log;
Link Here
|
| 36 |
sub usage { |
36 |
sub usage { |
| 37 |
print STDERR <<USAGE; |
37 |
print STDERR <<USAGE; |
| 38 |
Usage: $0 [-h|--help] |
38 |
Usage: $0 [-h|--help] |
|
|
39 |
-c --confirm required to actually perform the anonymization |
| 39 |
-v --verbose gives a little more information |
40 |
-v --verbose gives a little more information |
| 40 |
-h --help prints this help message, and exits, ignoring all |
41 |
-h --help prints this help message, and exits, ignoring all |
| 41 |
other options |
42 |
other options |
|
Lines 44-54
USAGE
Link Here
|
| 44 |
exit $_[0]; |
45 |
exit $_[0]; |
| 45 |
} |
46 |
} |
| 46 |
|
47 |
|
| 47 |
my ( $help, $verbose ); |
48 |
my ( $help, $verbose, $confirm ); |
| 48 |
|
49 |
|
| 49 |
GetOptions( |
50 |
GetOptions( |
| 50 |
'h|help' => \$help, |
51 |
'h|help' => \$help, |
| 51 |
'v|verbose' => \$verbose, |
52 |
'v|verbose' => \$verbose, |
|
|
53 |
'c|confirm' => \$confirm, |
| 52 |
) || usage(1); |
54 |
) || usage(1); |
| 53 |
|
55 |
|
| 54 |
if ($help) { |
56 |
if ($help) { |
|
Lines 62-67
if ( !$pref ) {
Link Here
|
| 62 |
usage(1); |
64 |
usage(1); |
| 63 |
} |
65 |
} |
| 64 |
|
66 |
|
|
|
67 |
unless ($confirm) { |
| 68 |
print STDERR "You must use the --confirm flag to run this script.\n"; |
| 69 |
print STDERR "Add --confirm to actually perform the anonymization.\n"; |
| 70 |
exit(1); |
| 71 |
} |
| 72 |
|
| 65 |
cronlogaction(); |
73 |
cronlogaction(); |
| 66 |
|
74 |
|
| 67 |
my $rows = Koha::Patrons->anonymize_last_borrowers(); |
75 |
my $rows = Koha::Patrons->anonymize_last_borrowers(); |
| 68 |
- |
|
|