[Koha-devel] Proposal for a new coding guideline for command line scripts

Jared Camins-Esakov jcamins at cpbibliography.com
Tue Jul 24 18:04:23 CEST 2012


Paul,


> I just pushed a few minuts ago a new script in misc (bug 8376, but it
> doesn't matter for this mail)
>
> This script has a help that is displayed when you run it with -h. So far
> so good.
>
> BUT, it has no PODDOC. Not so good.
>
> I've discovered recently that we could use:
> > use Pod::Usage;
> >
> > sub usage {
> >     pod2usage( -verbose => 2 );
> >     exit;
> > }
> > <snip>
> > usage() if $help;
>
> That will deal with both POD and -h flag. It's used in some scripts like
> misc/maintenance/touch_all_biblios.pl
>
> Do we agree it's a good idea to request that for future scripts, and add
> this in the coding guidelines ?
>

+1 from me

Regards,
Jared

-- 
Jared Camins-Esakov
Bibliographer, C & P Bibliography Services, LLC
(phone) +1 (917) 727-3445
(e-mail) jcamins at cpbibliography.com
(web) http://www.cpbibliography.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20120724/69ebfe3f/attachment.htm>


More information about the Koha-devel mailing list