Proposal for "Console_GetoptPlus"

» Metadata » Status
  • Category: Console
  • Proposer: Michel Corne 
  • License: BSD Style
» Description
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.
» Dependencies » Links
  • PEAR/Exception.php
» Timeline » Changelog
  • First Draft: 2008-01-10
  • Proposal: 2008-01-10
  • Call for Votes: 2008-01-17