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

Class: Console_CommandLine_Command

Source Location: /Console_CommandLine-1.2.0/Console/CommandLine/Command.php

Class Overview

Console_CommandLine
   |
   --Console_CommandLine_Command

Class that represent a command with option and arguments.


Author(s):

Version:

  • Release: 1.2.0

Copyright:

  • 2007 David JEAN LOUIS

Variables

Methods


Inherited Variables

Inherited Methods

Class: Console_CommandLine

Console_CommandLine::__construct()
Constructor.
Console_CommandLine::accept()
Method to allow Console_CommandLine to accept either:
Console_CommandLine::addArgument()
Adds an argument to the command line parser and returns it.
Console_CommandLine::addBuiltinOptions()
Adds the builtin "Help" and "Version" options if needed.
Console_CommandLine::addCommand()
Adds a sub-command to the command line parser.
Console_CommandLine::addOption()
Adds an option to the command line parser and returns it.
Console_CommandLine::displayError()
Displays an error to the user via stderr and exit with $exitCode if its value is not equals to false.
Console_CommandLine::displayUsage()
Displays the usage help message to the user via stdout and exit with $exitCode if its value is not equals to false.
Console_CommandLine::displayVersion()
Displays the program version to the user via stdout and exit with $exitCode if its value is not equals to false.
Console_CommandLine::findOption()
Finds the option that matches the given short_name (ex: -v), long_name (ex: --verbose) or name (ex: verbose).
Console_CommandLine::fromXmlFile()
Returns a command line parser instance built from an xml file.
Console_CommandLine::fromXmlString()
Returns a command line parser instance built from an xml string.
Console_CommandLine::getArgcArgv()
Tries to return an array containing argc and argv, or trigger an error if it fails to get them.
Console_CommandLine::parse()
Parses the command line arguments and returns a Console_CommandLine_Result instance.
Console_CommandLine::parseToken()
Parses the command line token and modifies *by reference* the $options and $args arrays.
Console_CommandLine::registerAction()
Registers a custom action for the parser, an example:
Console_CommandLine::triggerError()
A wrapper for programming errors triggering.

Class Details

[line 46]
Class that represent a command with option and arguments.

This class exist just to clarify the interface but at the moment it is strictly identical to Console_CommandLine class, it could change in the future though.



[ Top ]


Class Variables

$aliases = array()

[line 55]

An array of aliases for the subcommand.
  • Var: Aliases for the subcommand.
  • Access: public

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 67]

void __construct( [array $params = array()])

Constructor.
  • Access: public

Overrides Console_CommandLine::__construct() (Constructor.)

Parameters:

array   $params     An optional array of parameters

[ Top ]


Documentation generated on Thu, 25 Oct 2012 08:00:03 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.