From eade67d6ab9de13de1cdc8f52c1b7912b7d3cf64 Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Sun, 28 Apr 2002 07:35:30 +0000 Subject: [PATCH] * implemented "list-remote-packages" command --- pear/PEAR/Command/Remote.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pear/PEAR/Command/Remote.php b/pear/PEAR/Command/Remote.php index 87f73c3846..4014149a7f 100644 --- a/pear/PEAR/Command/Remote.php +++ b/pear/PEAR/Command/Remote.php @@ -86,6 +86,27 @@ class PEAR_Command_Remote extends PEAR_Command_Common // {{{ list-remote-packages case 'list-remote-packages': { + $r = new PEAR_Remote($this->config); + $available = $r->call('package.listAll', true); + if (PEAR::isError($available)) { + return $this->raiseError($available); + } + $i = $j = 0; + $this->ui->startTable( + array('caption' => 'Available packages:', + 'border' => true)); + foreach ($available as $name => $info) { + if ($i++ % 20 == 0) { + $this->ui->tableRow( + array('Package', 'Version'), + array('bold' => true)); + } + $this->ui->tableRow(array($name, $info['stable'])); + } + if ($i == 0) { + $this->ui->tableRow(array('(no packages installed yet)')); + } + $this->ui->endTable(); break; } -- 2.50.1