cvs: php4 /pear/scripts pear.in
| From: | Thomas V.V.Cox | Date: | Tue, 18 Dec 2001 08:48:28 +0000 |
| Subject: | cvs: php4 /pear/scripts pear.in | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1601@lists.php.net to get a copy of this message | ||
cox Tue Dec 18 03:48:28 2001 EDT
Modified files:
/php4/pear/scripts pear.in
Log:
quick fix for the "pear info" command
Index: php4/pear/scripts/pear.in
diff -u php4/pear/scripts/pear.in:1.22 php4/pear/scripts/pear.in:1.23
--- php4/pear/scripts/pear.in:1.22 Tue Dec 11 20:35:03 2001
+++ php4/pear/scripts/pear.in Tue Dec 18 03:48:28 2001
@@ -52,7 +52,6 @@
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 @@
// }}}
switch ($command) {
+
// {{{ install
case 'install': case 'upgrade': {
@@ -384,15 +384,24 @@
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);
}
}