Console_Getopt::getopt

Console_Getopt::getopt -- fetch the command-line options

Synopsis

require_once 'Console/Getopt.php';

array getopt (array $args, string $shortoptions [, array $longoptions = NULL])

Описание

Parses the command-line options and returns them.

Параметр

Возвращаемое значение

array - two-element array containing the list of parsed options and the non-option arguments or a PEAR_Error.

Throws

Таблица 33-1. Возможные значения PEAR_Error

Error codeError messageReasonSolution
NULL "Console_Getopt: option --$opt is ambiguous" Two or more long options starts with the same character. Change the naming of the options. It is also possible that the error is caused by a typing mistake.
NULL "Console_Getopt: option --$opt requires an argument" No parameter for a option was given. Normally this is a user mistake. If the parameter is optional, you have to markup the parameter as optional in the option definitions.
NULL "Console_Getopt: option --$opt doesn't allow an argument" A parameter for a option was given. Normally this is a user mistake. If the option requires a (optional) parameter, you have to markup it in the options definition.
NULL "Console_Getopt: unrecognized option --$opt" Unknown option. Normally this is a user mistake. If the option exists, you have to define them in the options definition.

Заметка

Эта функция не должна вызываться статически.


HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ