Getopt::Lucid

Getopt::Lucid is a clear, readable syntax for command line processing.
Download

Getopt::Lucid Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • David A. Golden
  • Publisher web site:
  • http://search.cpan.org/~dagolden/CPAN-Reporter-Smoker-0.15/lib/CPAN/Reporter/Smoker.pod

Getopt::Lucid Tags


Getopt::Lucid Description

Getopt::Lucid is a clear, readable syntax for command line processing. Getopt::Lucid is a clear, readable syntax for command line processing.SYNOPSIS use Getopt::Lucid qw( :all ); # basic option specifications with aliases @specs = ( Switch("version|V"), Counter("verbose|v"), Param("config|C"), List("lib|l|I"), Keypair("define"), Switch("help|h") ); $opt = Getopt::Lucid->getopt( @specs ); $verbosity = $opt->get_verbose; @libs = $opt->get_lib; fs = $opt->get_define; %all_options = $opt->options; # advanced option specifications @adv_spec = ( Param("input")->required, # required Param("mode")->default("tcp"), # defaults Param("host")->needs("port"), # dependencies Param("port", qr/d+/ )->required, # regex validation Param("config", sub { -r } ), # custom validation Param("help")->anycase, # case insensitivity ); # example with a config file use Config::Std; if ( -r $opt->get_config ) { read_config( $opt->get_config() => my %config_hash ); $opt->merge_defaults( $config_hash{''} ); }The goal of this module is providing good code readability and clarity of intent for command-line option processing. While readability is a subjective standard, Getopt::Lucid relies on a more verbose, plain-English option specification as compared against the more symbolic approach of Getopt::Long.Here are some key features of "Getopt Lucid":· Five option types: switches, counters, parameters, lists, and keypairs· Three option styles: long, short (including bundled), and bare (without dashes)· Specification of defaults, required options and option dependencies· Validation of options with regexes or subroutines· Negation of options on the command line· Support for parsing any array, not just the default @ARGV· Incorporation of external defaults (e.g. from a config file) with user control of precedenceRequirements:· Perl Here are some key features of "Getopt::Lucid": · Five option types: switches, counters, parameters, lists, and keypairs · Three option styles: long, short (including bundled), and bare (without dashes) · Specification of defaults, required options and option dependencies · Validation of options with regexes or subroutines · Negation of options on the command line · Support for parsing any array, not just the default @ARGV · Incorporation of external defaults (e.g. from a config file) with user control of precedence Requirements: · Perl


Getopt::Lucid Related Software