Skip to content

Commit

Permalink
use the new Console_Getopt::readPHPArgv() function to read args
Browse files Browse the repository at this point in the history
  • Loading branch information
tvvcox committed Jan 6, 2002
1 parent db50877 commit ce82f62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions pear/scripts/pear-get.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ require_once 'Console/Getopt.php';

error_reporting(E_ALL & ~E_NOTICE);

PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n");

// {{{ config file and option parsing
if (!isset($argv)) {
die("Could not read cmd args (register_argc_argv=Off?)\n");
$argv = Console_Getopt::readPHPArgv();
if (PEAR::isError($argv)) {
die($argv->getMessage());
}
$options = Console_Getopt::getopt($argv, "c:C:d:D:h?qu:v");
$options = Console_Getopt::getopt($argv, "c:C:d:D:h?sSqu:v");
if (PEAR::isError($options)) {
usage($options);
}

PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n");

if (OS_WINDOWS) {
$pear_default_config = PHP_SYSCONFDIR.DIRECTORY_SEPARATOR.'pearsys.ini';
$pear_user_config = PHP_SYSCONFDIR.DIRECTORY_SEPARATOR.'pear.ini';
Expand Down
10 changes: 5 additions & 5 deletions pear/scripts/pear.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ require_once 'Console/Getopt.php';

error_reporting(E_ALL & ~E_NOTICE);

PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n");

// {{{ config file and option parsing
if (!isset($argv)) {
die("Could not read cmd args (register_argc_argv=Off?)\n");
$argv = Console_Getopt::readPHPArgv();
if (PEAR::isError($argv)) {
die($argv->getMessage());
}
$options = Console_Getopt::getopt($argv, "c:C:d:D:h?sSqu:v");
if (PEAR::isError($options)) {
usage($options);
}

PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n");

if (OS_WINDOWS) {
$pear_default_config = PHP_SYSCONFDIR.DIRECTORY_SEPARATOR.'pearsys.ini';
$pear_user_config = PHP_SYSCONFDIR.DIRECTORY_SEPARATOR.'pear.ini';
Expand Down

0 comments on commit ce82f62

Please sign in to comment.