Getopt::Tiny

Getopt::Tiny is yet another command line argument parsing module.
Download

Getopt::Tiny Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • David Muir Sharnoff
  • Publisher web site:
  • http://search.cpan.org/~muir/

Getopt::Tiny Tags


Getopt::Tiny Description

Getopt::Tiny is yet another command line argument parsing module. Getopt::Tiny is yet another command line argument parsing module.SYNOPSIS use Getopt::Tiny; my $arg = 'default value'; my @list; my %hash; my $flag; my %set; # begin usage info my (%flags) = ( 'argx' => $arg, # set a parameter 'listx' => @list, # fill in a list 'hashx' => %hash, # set key/value pairs ); my (%switches) = ( 'flagx' => $flag, # on or off } # end usage info getopt(@ARGV, %flags, %switches, $what_comes_after); Getopt::Tiny::usage(__FILE__, %flags, %switches, 'files');or use Getopt::Tiny; %flags = ... %switches = ... getopt() Getopt::Tiny::usage();Getopt::Tiny is yet another argument parsing module. The results of the argument parsing are stored by using references that were provided to getopt(). Usage information is automatically generated. Getopt::Tiny expects all arguments to be switches -- no trailing list of files.Getopt::Tiny can either call an existing usage() function or it can use it's own builtin one. It trys to use the existing one by default. If that fails, it will use its own. It figures out how to describe things by reading the file where call to getopt() originated. In the file where getopt is called, the following two lines must appear exactly as written here: # begin usage info # end usage infoBetween these two lines, lines that match the pattern of: 'someflag' => ... # a descriptionwill be noticed and used to document each flag individually.The usage() function of Getopt::Tiny can be called on it's own. It can either have it's arguments given to it explicitly or it can default them like getopt().If a usage function is provided, it will be called with one parameter: the argument that didn't parse.Getopt::Tiny can be used in situation where it is expected to parse the entire command line and in situations where there will be command line args left over. When Getopt::Tiny is expected to parse the whole command line, do not include a forth argument to getopt(). When it is expected that there will be stuff left over, pass a description of what should be left over as the forth argument to getopt(). Requirements: · Perl


Getopt::Tiny Related Software