Getopt::Long::Less - Like Getopt::Long, but with less features
This document describes version 0.08 of Getopt::Long::Less (from Perl distribution Getopt-Long-Less), released on 2016-12-03.
This module is a reimplementation of Getopt::Long, with less features/configurability. Only the subset which I'm currently using (which I think already serves a lot of common use cases for a lot of people too) is implemented.
Only three functions are implemented: GetOptions, GetOptionsFromArray, and Configure.
No configuring from
use statement. No OO interface.
Much much less modes/configuration. No support for POSIXLY_CORRECT. We always do bundling (this is not Getopt::Long's default), we never ignore case (this is not Getopt::Long's default), we always permute, we always autoabbreviate, we always do GNU compatibility (allow
--opt=VAL in addition to
--opt VAL including allowing
--opt=), we never do getopt_compat. Basically currently there's no mode you can configure (although pass_through might be added in the future).
No autoversion, no autohelp. No support to configure prefix pattern.
Currently no support for arrayref handler (e.g.
"foo=s" => \@ary). No support for array desttype (
'foo=s@' => ...).
Also, this module requires 5.010.
So what's good about this module? Slightly less compile time overhead, due to less code. This should not matter for most people. I just like squeezing out milliseconds from startup overhead of my CLI scripts. That's it :-)
Sample startup overhead benchmark:
Rate load_gl load_glless perl load_gl 77.72+-0.25/s -- -42.4% -86.9% load_glless 135+-0.28/s 73.7+-0.67% -- -77.3% perl 594.5+-2.1/s 665+-3.7% 340.4+-1.8% -- Average times: perl : 1.6821ms load_glless: 7.4074ms load_gl : 12.8667ms
Please visit the project's homepage at https://metacpan.org/release/Getopt-Long-Less.
Source repository is at https://github.com/perlancar/perl-Getopt-Long-Less.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Getopt-Long-Less
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
If you want more features intead of less, try Getopt::Long::More.
This software is copyright (c) 2016 by firstname.lastname@example.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.