Bugzilla – Attachment 71765 Details for
Bug 12598
New misc/import_borrowers.pl command line tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12598: Use Pod::Usage and make the help more explicit
Bug-12598-Use-PodUsage-and-make-the-help-more-expl.patch (text/plain), 3.12 KB, created by
Kyle M Hall (khall)
on 2018-02-16 13:46:47 UTC
(
hide
)
Description:
Bug 12598: Use Pod::Usage and make the help more explicit
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-02-16 13:46:47 UTC
Size:
3.12 KB
patch
obsolete
>From 0b49b963365b5f336cd47dd8de3a1f4834f6804b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 4 Jan 2018 10:06:17 -0300 >Subject: [PATCH] Bug 12598: Use Pod::Usage and make the help more explicit > >--- > misc/import_patrons.pl | 69 +++++++++++++++++++++++++++++++++++++++----------- > 1 file changed, 54 insertions(+), 15 deletions(-) > >diff --git a/misc/import_patrons.pl b/misc/import_patrons.pl >index de728a4..203ac4c 100755 >--- a/misc/import_patrons.pl >+++ b/misc/import_patrons.pl >@@ -20,6 +20,7 @@ > use Modern::Perl; > > use Getopt::Long; >+use Pod::Usage; > > use Koha::Patrons::Import; > my $Import = Koha::Patrons::Import->new(); >@@ -42,9 +43,13 @@ GetOptions( > 'p|preserve-extended-atributes' => \$ext_preserve, > 'v|verbose+' => \$verbose, > 'h|help|?' => \$help, >-); >+) or pod2usage(2); >+ >+pod2usage(1) if $help; >+pod2usage(q|--file is required|) unless $csv_file; >+pod2usage(q|--matchpoint is required|) unless $matchpoint; > >-print_help() if ( $help || !$csv_file || !$matchpoint || !$confirm ); >+warn "Running in dry-run mode, provide --confirm to apply the changes\n" unless $confirm; > > my $handle; > open( $handle, "<", $csv_file ) or die $!; >@@ -88,16 +93,50 @@ if ($verbose > 2 ) { > say Data::Dumper::Dumper( $feedback ); > } > >-sub print_help { >- print <<_USAGE_; >-import_patrons.pl -c /path/to/patrons.csv -m cardnumber >- -c --confirm Confirms you really want to import these patrons, otherwise prints this help >- -f --file Path to the CSV file of patrons to import >- -m --matchpoint Field on which to match incoming patrons to existing patrons >- -d --default Set defaults to patron fields, repeatable e.g. --default branchcode=MPL --default categorycode=PT >- -p --preserve-extended-atributes Retain extended patron attributes for existing patrons being overwritten >- -o --overwrite Overwrite existing patrons with new data if a match is found >- -v --verbose Be verbose >-_USAGE_ >- exit; >-} >+=head1 NAME >+ >+import_patrons.pl - CLI script to import patrons data into Koha >+ >+=head1 SYNOPSIS >+ >+import_patrons.pl --file /path/to/patrons.csv --matchpoint cardnumber --confirm [--default branchcode=MPL] [--overwrite] [--preserve-extended-atributes] [--verbose] >+ >+=head1 OPTIONS >+ >+=over8 >+ >+=item B<-h|--help> >+ >+Prints a brief help message and exits >+ >+=item B<-c|--confirm> >+ >+Confirms you really want to import these patrons, otherwise prints this help >+ >+=item B<-f|--file> >+ >+Path to the CSV file of patrons to import >+ >+=item B<-c|--matchpoint> >+ >+Field on which to match incoming patrons to existing patrons >+ >+=item B<-d|--default> >+ >+Set defaults to patron fields, repeatable e.g. --default branchcode=MPL --default categorycode=PT >+ >+=item B<-o|--overwrite> >+ >+Overwrite existing patrons with new data if a match is found >+ >+=item B<-p|--preserve-extended-atributes> >+ >+Retain extended patron attributes for existing patrons being overwritten >+ >+=item B<-v|--verbose> >+ >+Be verbose >+ >+=back >+ >+=cut >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12598
:
29807
|
29808
|
29809
|
29939
|
30755
|
30780
|
35557
|
35558
|
35559
|
35560
|
35848
|
35849
|
35850
|
35851
|
35964
|
36684
|
36685
|
36687
|
36688
|
36690
|
36692
|
36693
|
36694
|
36695
|
36696
|
39124
|
39125
|
39126
|
39127
|
39128
|
41790
|
41791
|
41792
|
41793
|
41794
|
44065
|
44066
|
44067
|
44068
|
44069
|
48753
|
48754
|
48755
|
48756
|
48757
|
50693
|
50694
|
50695
|
50696
|
50697
|
50698
|
50699
|
50700
|
50704
|
51122
|
51357
|
51358
|
51359
|
51360
|
51361
|
51362
|
51363
|
51364
|
51365
|
51366
|
51367
|
51368
|
51369
|
51370
|
51371
|
51372
|
52323
|
52324
|
52325
|
52326
|
52327
|
52328
|
52329
|
52330
|
52331
|
52332
|
52333
|
52540
|
64437
|
64438
|
64855
|
65214
|
65215
|
65216
|
65217
|
65218
|
65819
|
65820
|
65821
|
65822
|
65823
|
65824
|
66353
|
66354
|
66355
|
66356
|
66357
|
66358
|
66359
|
66575
|
66576
|
66577
|
66578
|
66579
|
66580
|
66581
|
66582
|
67276
|
67277
|
70265
|
70266
|
71755
|
71756
|
71757
|
71758
|
71759
|
71760
|
71761
|
71762
|
71763
|
71764
| 71765 |
71766