|
NAMEGetopt::EX::Loader - RC/Module loaderSYNOPSISuse Getopt::EX::Loader; my $loader = new Getopt::EX::Loader BASECLASS => 'App::example'; $loader->load_file("$ENV{HOME}/.examplerc"); $loader->deal_with(\@ARGV); my $parser = new Getopt::Long::Parser; $parser->getoptions( ... , $loader->builtins ) DESCRIPTIONThis is the main interface to use Getopt::EX modules. You can create loader object, load user defined rc file, load modules specified by command arguments, substitute user defined option and insert default options defined in rc file or modules, get module defined built-in option definition for option parser.Most of work is done in "deal_with" method. It parses command arguments and load modules specified by -M option by default. Then it scans options and substitute them according to the definitions in rc file or modules. If RC and modules defines default options, they are inserted to the arguments. Module can define built-in options which should be handled option parser. They can be taken by "builtins" method, so you should give them to option parser. If "App::example" is given as a "BASECLASS" of the loader object, it is prepended to all module names. So command line % example -Mfoo will load "App::example::foo" module. In this case, if module "App::example::default" exists, it is loaded automatically without explicit indication. Default module can be used just like a startup RC file. METHODS
Visit the GSP FreeBSD Man Page Interface. |