OptArgs

Integrated argument and option processing for Perl
Download

OptArgs Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Mark Lawrence
  • Publisher web site:
  • http://search.cpan.org/~mlawren/

OptArgs Tags


OptArgs Description

OptArgs is a Perl module that provides command-line option and argument processing for Perl scripts. It is designed to be a very simple way to write programs using a declarative style. Getopt::Long is used for the underlying parsing.How exactly does one define a command line application? OptArgs assumes a fairly common (but by no means universal) approach:Command The program name - i.e. the filename be executed by the shell.Options Options are parameters that affect the way a command runs. They are generally not required to be present, but that is configurable. Options are prefixed with '-' for single letter option names or '--' for long option names.Arguments Arguments are positional parameters that that a command needs know in order to do its work. Some arguments may be optional.Sub-commands A command may also have sub-commands with their own options and arguments. From the users point of view sub-commands and their options are indisinguishable from options and arguments to the main command, but from an implementation perspective they could (perhaps should) be separate, stand-alone programs, with possibly their own set of sub-commands.SYNOPSIS use OptArgs; opt quiet => ( isa => 'Bool', alias => 'q', comment => 'be quiet please', ); arg item => ( isa => 'Str', default => 1, comment => 'try this many times', ); my $ref = optargs; print "Working on: $ref->{item}\n" unless $ref->{quiet};Product's homepage


OptArgs Related Software