Console_GetoptPlus
[ class tree: Console_GetoptPlus ] [ index: Console_GetoptPlus ] [ all elements ]

File: GetoptPlus.php

Source Location: /Console_GetoptPlus-1.0.0RC1/GetoptPlus.php

Classes:

Console_GetoptPlus
Parsing of a command line based on the command description in an array.

Page Details:

Command-line option parser - Console Getopt+ (Getopt Plus)

This package is (1) a PHP5 port/rewrite of Console_Getopt, (2) with added functionalities, and (3) with a Web interface to run getopt-like shell commands through a browser (not implemented yet).

(1) Console_getoptPlus:getopt() is a replacement for Console_getopt:getopt(). Same for getopt2() and readPHPArgv(). It returns PEAR_Exception instead of PEAR_Error. Error messages are the same.

(2) GetoptPlus:getoptplus uses an array-based description of the command. It can generates the command usage/help automaticly. It can return the parsed options and parameters in an associative array. It can be set to accept option shortcut names.

Fully tested with phpUnit. Code coverage test close to 100%.

Usage is fully documented in docs/examples files.

PHP version 5

All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • The names of its contributors may not be used to endorse or promote
products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Includes:

require_once('Console/GetoptPlus/Getopt.php') [line 56]
require_once('Console/GetoptPlus/Help.php') [line 57]

Documentation generated on Sat, 26 Jan 2008 14:30:05 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.