Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Getopt::ExPar 0.01

    Download button

    No screenshots available
    Downloads: 378  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.0/5)
    1 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Harlin L. Hamilton Jr. | More programs
    Perl Artistic License / FREE
    August 7th, 2007, 12:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Getopt::ExPar description

    Getopt::ExPar contains extended parameters command line parser.

    Getopt::ExPar contains extended parameters command line parser.

    SYNOPSIS

    use Getopt::ExPar;

    my(@PDT, @MM, %OPT);
    ExPar @PDT, @MM, $OPT;

    EXPORT

    use Getopt::ExPar exports the sub ExPar into your name space.

    ExPar is a perl5 module used to parse command line parameters. This package uses the @PDT, Parameter Description Table, and the @MM, Message Module, to return %OPT which is a hash reference containing the command line option data. The function of Getopt::ExPar is based on Getopt::EvaP, created by Stephen O. Lidie.

    Introduction

    The ExPar function parses a perl command line. Using the option definitions in the @PDT, argument types are checked and the arguments themselves may be checked against a specified range or pattern. By using both @PDT and @MM, several types of help may be retured to the user. ExPar handles command lines with this format:

    command [-parameters] [file_list]

    where any parameters and file_list are optional.

    Parameter Description Table (PDT) Syntax

    Here is the PDT syntax. Optional constructs are enclosed in [], and the | character separates possible values in a list.

    PDT [program_name, alias]
    [parameter_name[, alias]: type [pattern | range] [ = [default_variable,] default_value]]
    PDTEND [flag_list]

    flag_list is one or more of the following flags: optional_file_list | required_file_list | no_file_list: specifies condition of list of files at end of command line. (only one of these may be specified) abbreviations: allows for abbreviations of commands or aliases as long as enough of the command is given to make it distinguishable from all others. If not, a message is printed so the user may be more specific. switchglomming: allows for multiple single-letter switch options to be specified as single option (must be first option). pdt_warnings: for debugging a @PDT, it prints out messages that are not necessarily errors, like inconsistent number of default values in a list, etc.
    The default_variable is an environment variable - see the section Usage Notes for complete details.

    So, the simplest possible PDT would be:

    PDT
    PDTEND

    This PDT would simply define a -help switch for the command, but is rather useless.

    A typical PDT would look more like this:

    PDT frog
    number, n: integer = 1
    chars, c: string = "default_string"
    PDTEND no_file_list

    This PDT, for command frog, defines two parameters, number (or n), of type integer with a default value of 1, and chars (or c), of type string with a default value of "default_string". The PDTEND no_file_list indicator indicates that no trailing file_list can appear on the command line. Of course, the -help switch is defined automatically.

    Each of these options may be further refined by using a range and a pattern, respectively:

    PDT frog
    number, n: integer (((#

    Product's homepage

      


    TAGS:

    extended parameters | Perl parser | Perl module | Getopt | extended | parameters

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM