Wetware::CLI - A base class wrapper on Getopt::Long::GetOptions()
use Wetware::CLI; my $cli = Wetware::CLI->new(); my $options_hash = $cli->get_options();
I looked around, and there is no simple wrapper on GetOptions().
So rather than have to keep cutting and pasting the same basic set of semi private methods. I have opted to create a CLI Object, that will do all of the work for me.
I will discuss the question of subclassing later on.
The list of Semi Private Methods explain basically how to make your own CLI sub class.
Takes no arguments, and creates a simple blessed has.
This wraps the Getopt::Long function.
If you are not planning to subclass this, do not worry about this.
If the help or pod option is set, then this will invoke the appropriate pod2usage() command.
Returns the hash reference of option defaults. As implemented this is an empty hash reference.
Returns the list of option specificans. As implemented this is merely the list help, pod, verbose.
This is called after the help_or_pod(). As implemented this will add the 'remaining_argv' attributes to the $opts hash ref, if @ARGV is not empty.
help_or_pod()
This should be overridden if the sub class will want to have a named value.
It returns self, if there were any remaining values. Otherwise it returns undef.
returns the list of required settings.
Check that all of the required options are set.
"drieux", <"drieux [AT] at wetware.com">
<"drieux [AT] at wetware.com">
Please report any bugs or feature requests to bug-wetware-cli at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Wetware-CLI. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-wetware-cli at rt.cpan.org
Getopt::Long;
use Pod::Usage;
At present I do not have any support solutions.
Copyright 2009 "drieux", all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Wetware::CLI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wetware::CLI
CPAN shell
perl -MCPAN -e shell install Wetware::CLI
For more information on module installation, please visit the detailed CPAN module installation guide.