Getopt::Compact

Getopt processing in a compact statement with both long and short options, and usage functionality.
Download

Getopt::Compact Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Andrew Stewart Williams
  • Publisher web site:
  • http://search.cpan.org/~asw/

Getopt::Compact Tags


Getopt::Compact Description

Getopt processing in a compact statement with both long and short options, and usage functionality. Getopt::Compact is a Perl module that allows getopt processing in a compact statement with both long and short options, and usage functionality.SYNOPSISinside foobar.pl: use Getopt::Compact; # (1) simple usage: my $opts = new Getopt::Compact (struct => , qq(baz option)], # -b or --baz , # --foobar only ])->opts(); # (2) or, a more advanced usage: my $go = new Getopt::Compact (name => 'foobar program', modes => , struct => , qq(specify a wibble parameter), ':s'], , qq(apply foobar algorithm)], , qq(jooby integer list), '=i', @joobs], ] ); my $opts = $go->opts; print "applying foobar algorithm " if $opt->{foobar}; print "joobs: @joobs " if @joobs; print $go->usage if MyModule::some_error_condition($opts);using (2), running the command './foobar.pl -x' results in the following output: Unknown option: x foobar program v1.0 usage: foobar.pl options -h, --help This help message -v, --verbose Verbose mode -n, --test Test mode -d, --debug Debug mode -w, --wibble Specify a wibble parameter -f, --foobar Apply foobar algorithm -j, --joobies Jooby integer list --man Display documentationThis is yet another Getopt related module. Getopt::Compact is geared towards compactly and yet quite powerfully describing an option syntax. Options can be parsed, returned as a hashref of values, and/or displayed as a usage string or within the script POD. Requirements: · Perl


Getopt::Compact Related Software