diff options
| author | Tomas V.V.Cox <cox@php.net> | 2001-12-18 08:48:28 +0000 |
|---|---|---|
| committer | Tomas V.V.Cox <cox@php.net> | 2001-12-18 08:48:28 +0000 |
| commit | be45657eea627d3a5ad0fa4f8afa1947d2d25c14 (patch) | |
| tree | 7ced00c7bc9f8a761003bc9f35f954872acbb938 /pear | |
| parent | b9288f35152d0b674ae05beb408ba97567d37c14 (diff) | |
| download | php-git-be45657eea627d3a5ad0fa4f8afa1947d2d25c14.tar.gz | |
quick fix for the "pear info" command
Diffstat (limited to 'pear')
| -rw-r--r-- | pear/scripts/pear.in | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/pear/scripts/pear.in b/pear/scripts/pear.in index 3782481b0c..decb069958 100644 --- a/pear/scripts/pear.in +++ b/pear/scripts/pear.in @@ -52,7 +52,6 @@ error_reporting(E_ALL & ~E_NOTICE); PEAR::setErrorHandling(PEAR_ERROR_PRINT, "pear: %s\n"); // {{{ config file and option parsing - $options = Console_Getopt::getopt($argv, "c:C:d:D:h?sSqu:v"); if (PEAR::isError($options)) { usage($options); @@ -172,6 +171,7 @@ if (isset($command_options[$command])) { // }}} switch ($command) { + // {{{ install case 'install': case 'upgrade': { @@ -384,15 +384,24 @@ function present_array(&$arr, $keys = null) if ($keys === null) { $keys = array_keys($arr); } - $longest_key = max(array_map("strlen", array_keys($arr))); + $longest_key = max(array_map("strlen", array_keys($arr))) + 2; $format_string = "%{$longest_key}s : %s\n"; foreach ($keys as $k) { if (is_array($arr[$k])) { - $v = implode(", ", $arr[$k]); + foreach ($arr[$k] as $i => $value) { + $x = "$k #$i"; + foreach(array_keys($value) as $val) { + $cont[] = "$val=" . $value[$val]; + } + $v = implode(", ", $cont); + $cont = array(); + printf($format_string, $x, $v); + } + continue; } else { $v = $arr[$k]; + printf($format_string, $k, $v); } - printf($format_string, $k, $v); } } |
