CBSSports-Getopt

 view release on metacpan or  search on metacpan

lib/CBSSports/Getopt.pm  view on Meta::CPAN

      'e|copy-to-end',    'q|quiet',         'n|do-nothing',
  );

If the script is executed without command line parameters, the hash reference returned from 
the GetOptions call (ex. $opts) will contain: 

  {
    'verbose'          => undef,
    'quiet'            => undef,
    'copy_to_end'      => undef,
    'version'          => undef,
    'range_point'      => undef,
    'source_point'     => undef,
    'single_point'     => undef,
    'do_nothing'       => undef,
    'copy_to_begining' => undef
  }

(Note: verbose and version are automatically defined for you)

=head2 Usage( message => $error_message, verbose => $verbosity_level )

Call usage with an error message string which will be displayed before
the output and verbosity level.  If no verbosity level is specified, 
Usage will only show USAGE and OPTIONS pod secitons.

=head2 Configure( $config1, $config2 );

Configure checks for 'allow_preset_override' before passing the rest of the arguments to 
Getopt::Long::Configure.  See L<Getopt::Long> for details.  'allow_preset_override' allows you
define '-h', '-H', and '-v' for another purpose other than their defaults.

=head1 CONFIGURATION AND ENVIRONMENT

By default, every command line script that uses CBSSports::Getopt will be able to pull commonly used 
options from an .rc file of the same name.  For example, 'auto-load-rosters' would use 
'.auto-load-rostersrc' from your home directory.  

Leading/trailing whitespace and comments in the '.rc' files are removed before processing.

=head1 DEPENDENCIES

CBSSports::Getopt has the following dependancies:

=over

=item *

Getopt::Long

=item *

Pod::Usage

=item *

File::HomeDir

=back

=head1 BUGS AND LIMITATIONS

Some scripts may use '-h', '-H' or '-v' for something other than 'help', 'verbose', 'man'.  You can
override these defaults via Configure( 'allow_preset_override' );

=head1 AUTHOR

Jeff Bisbee  C<< <jbisbee@cbs.com> >>

=head1 LICENCE AND COPYRIGHT

Copyright (c) 2009, Jeff Bisbee C<< <jbisbee@cbs.com> >>. All rights reserved.

This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.

=head1 DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.



( run in 1.700 second using v1.01-cache-2.11-cpan-39bf76dae61 )