logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Getopt::Long::Parser - Getopt::Long object oriented interface

Author

Johan Vromans <jvromans@squirrel.nl>

Constructor

my $p = Getopt::Long::Parser->new( %options ); The constructor takes an optional hash with parameters. config An array reference with configuration settings. See "Configuring Getopt::Long" in Getopt::Long for all possible settings.

Description

Getopt::Long::Parser is an object oriented interface to Getopt::Long. See its documentation for configuration and use. Note that Getopt::Long and Getopt::Long::Parser are not object oriented. Getopt::Long::Parser emulates an object oriented interface, which should be okay for most purposes.

Methods

In the examples, $p is assumed to be the result of a call to the constructor. configure $p->configure( %settings ); Update the current config settings. See "Configuring Getopt::Long" in Getopt::Long for all possible settings. getoptionsfromarray $res = $p->getoptionsfromarray( $aref, @opts ); getoptions $res = $p->getoptions( @opts ); The same as getoptionsfromarray( \@ARGV, @opts ).

Name

Getopt::Long::Parser - Getopt::Long object oriented interface

See Also

Getopt::Long

Synopsis

use Getopt::Long::Parser; my $p = Getopt::Long::Parser->new; $p->configure( ...configuration options... ); if ( $p->getoptions( ...options descriptions... ) ) ... if ( $p->getoptionsfromarray( \@array, ...options descriptions... ) ) ... Configuration options can be passed to the constructor: my $p = Getopt::Long::Parser->new config => [...configuration options...];

See Also