Link Here
|
10 |
use C4::Log; |
10 |
use C4::Log; |
11 |
use POSIX qw(strftime); |
11 |
use POSIX qw(strftime); |
12 |
|
12 |
|
13 |
my ( $help, $verbose, $force ); |
13 |
my ( $help, $verbose, $force, $quiet ); |
14 |
GetOptions( |
14 |
GetOptions( |
15 |
'h|help' => \$help, |
15 |
'h|help' => \$help, |
16 |
'v|verbose' => \$verbose, |
16 |
'v|verbose' => \$verbose, |
17 |
'f|force' => \$force, |
17 |
'f|force' => \$force, |
|
|
18 |
'q|quiet' => \$quiet, |
18 |
) || pod2usage(1); |
19 |
) || pod2usage(1); |
19 |
|
20 |
|
20 |
if ($help) { |
21 |
if ($help) { |
21 |
pod2usage(1); |
22 |
pod2usage(1); |
|
|
23 |
exit; |
22 |
} |
24 |
} |
23 |
|
25 |
|
24 |
unless ( C4::Context->preference('UsageStats') ) { |
26 |
unless ( C4::Context->preference('UsageStats') ) { |
|
|
27 |
$quiet && exit; |
25 |
pod2usage( |
28 |
pod2usage( |
26 |
q| |
29 |
q| |
27 |
The UsageStats system preference is not set. |
30 |
The UsageStats system preference is not set. |
28 |
If your library wants to share their usage statistics with the Koha community, you have to switch on this system preference |
31 |
If your library wants to share their usage statistics with the Koha community, you have to switch on this system preference |
|
|
32 |
|
33 |
Setting the quiet flag will silence this message. |
29 |
| |
34 |
| |
30 |
); |
35 |
); |
31 |
exit 1; |
36 |
exit 1; |
Link Here
|
52 |
|
57 |
|
53 |
=head1 SYNOPSIS |
58 |
=head1 SYNOPSIS |
54 |
|
59 |
|
55 |
share_usage_with_koha_community.pl [-h|--help] [-v|--verbose] |
60 |
share_usage_with_koha_community.pl [-h|--help] [-v|--verbose] [-f|--force] [-q|--quiet] |
56 |
|
61 |
|
57 |
If the UsageStats system preference is set, you can launch this script to share your usage data |
62 |
If the UsageStats system preference is set, you can launch this script to share your usage data |
58 |
anonymously with the Koha community. |
63 |
anonymously with the Koha community. |
Link Here
|
83 |
|
88 |
|
84 |
=item B<-v|--verbose> |
89 |
=item B<-v|--verbose> |
85 |
|
90 |
|
86 |
Verbose mode. |
91 |
Verbose mode |
87 |
|
92 |
|
88 |
=item B<-f|--force> |
93 |
=item B<-f|--force> |
89 |
|
94 |
|
90 |
Force the update. |
95 |
Force the update |
|
|
96 |
|
97 |
=item B<-q|--quiet> |
98 |
|
99 |
Do not emit "The UsageStats system preference is not set" message |
91 |
|
100 |
|
92 |
=back |
101 |
=back |
93 |
|
102 |
|
94 |
- |
|
|