Name : perl-Getopt-Panjang
| |
Version : 0.04
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp155.1.1
| Date : 2023-07-20 17:07:27
|
Group : Development/Libraries/Perl
| Source RPM : perl-Getopt-Panjang-0.04-lp155.1.1.src.rpm
|
Size : 0.04 MB
| |
Packager : https://www_suse_com/
| |
Summary : Parse command-line options
|
Description :
*EXPERIMENTAL WORK*.
This module is similar to the Getopt::Long manpage, but with a rather different interface. After experimenting with the Getopt::Long::Less manpage and the Getopt::Long::EvenLess manpage (which offers interface compatibility with Getopt::Long), I\'m now trying a different interface which will enable me to \"clean up\" or do \"more advanced\" stuffs.
Here are the goals of Getopt::Panjang:
* * low startup overhead
Less than Getopt::Long, comparable to Getopt::Long::EvenLess.
* * feature parity with Getopt::Long::EvenLess
More features will be offered in the future.
* * more detailed error return
This is the main goal which motivates me to write Getopt::Panjang. In Getopt::Long, if there is an error like an unknown option, or validation error for an option\'s value, or missing option value, you only get a string warning. Getopt::Panjang will instead return a data structure with more details so you can know which option is missing the value, which unknown option is specified by the user, etc. This will enable scripts/frameworks to do something about it, e.g. suggest the correct option when mistyped.
The interface differences with Getopt::Long:
* * There is only a single function, and no default exports
Getopt::Long has \'GetOptions\', \'GetOptionsFromArray\', \'GetOptionsFromString\'. We only offer \'get_options\' which must be exported explicitly.
* * capitalization of function names
Lowercase with underscores (\'get_options\') is used instead of camel case (\'GetOptions\').
* * \'get_options\' accepts hash argument
This future-proofs the function when we want to add more configuration.
* * option handler also accepts hash argument
This future-proofs the handler when we want to give more arguments to the handler.
* * There are no globals
Every configuration is specified through the \'get_options\' function. This is cleaner.
* * \'get_options\' never dies, never prints warnings
It only returns the detailed error structure so you can do whatever about it.
* * \'get_options\' never modifies argv/AATTARGV
Remaining argv after parsing is returned in the result metadata.
Sample startup overhead benchmark:
Rate load_gl run_gl load_gp run_gp run_gl_less load_gl_less load_gl_evenless run_gl_evenless perl load_gl 73.23+-0.35/s -- -2.6% -65.4% -65.5% -68.0% -70.9% -78.9% -80.0% -88.7% run_gl 75.22+-0.17/s 2.71+-0.55% -- -64.4% -64.6% -67.2% -70.1% -78.3% -79.4% -88.3% load_gp 211.4+-2.2/s 188.7+-3.3% 181.1+-2.9% -- -0.5% -7.7% -16.0% -39.1% -42.2% -67.2% run_gp 212.44+-0.86/s 190.1+-1.8% 182.4+-1.3% 0.5+-1.1% -- -7.2% -15.6% -38.8% -41.9% -67.1% run_gl_less 229+-1.3/s 212.7+-2.3% 204.5+-1.8% 8.3+-1.3% 7.8+-0.74% -- -9.0% -34.0% -37.4% -64.5% load_gl_less 251.76+-0.83/s 243.8+-2% 234.7+-1.4% 19.1+-1.3% 18.51+-0.62% 9.93+-0.71% -- -27.5% -31.2% -61.0% load_gl_evenless 347.1+-3.5/s 374+-5.3% 361.5+-4.8% 64.2+-2.4% 63.4+-1.8% 51.6+-1.7% 37.9+-1.5% -- -5.1% -46.2% run_gl_evenless 365.7+-1.8/s 399.4+-3.4% 386.2+-2.6% 73+-2% 72.1+-1.1% 59.7+-1.2% 45.26+-0.85% 5.3+-1.2% -- -43.4% perl 645.6+-6.8/s 782+-10% 758.3+-9.3% 205.3+-4.5% 203.9+-3.4% 181.9+-3.4% 156.4+-2.8% 86+-2.7% 76.5+-2.1% --
Average times: perl : 1.5489ms run_gl_evenless : 2.7345ms load_gl_evenless: 2.8810ms load_gl_less : 3.9720ms run_gl_less : 4.3668ms run_gp : 4.7072ms load_gp : 4.7304ms run_gl : 13.2943ms load_gl : 13.6556ms
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-G/15.5/noarch |