cvs: pear /Services_Amazon_SQS/Services/Amazon/SQS CLI.php

From: Date: Tue, 24 Mar 2009 03:55:11 +0000
Subject: cvs: pear /Services_Amazon_SQS/Services/Amazon/SQS CLI.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-55848@lists.php.net to get a copy of this message
gauthierm Tue Mar 24 03:55:11 2009 UTC Modified files: /pear/Services_Amazon_SQS/Services/Amazon/SQS CLI.php Log: Make displaying headers optional. http://cvs.php.net/viewvc.cgi/pear/Services_Amazon_SQS/Services/Amazon/SQS/CLI.php?r1=1.5&r2=1.6&diff_format=u Index: pear/Services_Amazon_SQS/Services/Amazon/SQS/CLI.php diff -u pear/Services_Amazon_SQS/Services/Amazon/SQS/CLI.php:1.5 pear/Services_Amazon_SQS/Services/Amazon/SQS/CLI.php:1.6 --- pear/Services_Amazon_SQS/Services/Amazon/SQS/CLI.php:1.5 Tue Mar 24 03:51:52 2009 +++ pear/Services_Amazon_SQS/Services/Amazon/SQS/CLI.php Tue Mar 24 03:55:11 2009 @@ -30,7 +30,7 @@ * @author Michael Gauthier <mike@silverorange.com> * @copyright 2008 Mike Brittain, 2008 silverorange * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 - * @version CVS: $Id: CLI.php,v 1.5 2009/03/24 03:51:52 gauthierm Exp $ + * @version CVS: $Id: CLI.php,v 1.6 2009/03/24 03:55:11 gauthierm Exp $ * @link http://pear.php.net/package/Services_Amazon_SQS * @link http://aws.amazon.com/sqs/ * @link http://s3.amazonaws.com/awsdocs/SQS/20080101/sqs-dg-20080101.pdf @@ -466,6 +466,9 @@ "\n" . "Lists available queues. If a prefix is specified, only queues " . "beginning with the specified prefix are listed.\n" . + "\n" . + "Options:\n" . + " -h, --no-headers Don\xe2\x80\x99t show list headers\n" . "\n" ); } @@ -539,13 +542,16 @@ /** * Lists SQS queues * - * @param string $prefix optional. Only list queues whose name begins with - * the given prefix. If not specified, all queues are - * returned. + * @param string $prefix optional. Only list queues whose name begins + * with the given prefix. If not specified, all + * queues are returned. + * @param boolean $showHeaders optional. Whether or not to show list headers + * in output. If not specified, list headers are + * shown. * * @return void */ - private function _listQueues($prefix = '') + private function _listQueues($prefix = '', $showHeaders = true) { $manager = $this->_getQueueManager(); @@ -579,11 +585,13 @@ $format = "%-55s %-10s %-10s\n"; - // display header - $this->_output(sprintf($format, '', 'ITEMS', 'VIS.')); - $this->_output( - sprintf($format, 'QUEUE NAME', '(APPROX.)', 'TIMEOUT') - ); + // display headers + if ($showHeaders) { + $this->_output(sprintf($format, '', 'ITEMS', 'VIS.')); + $this->_output( + sprintf($format, 'QUEUE NAME', '(APPROX.)', 'TIMEOUT') + ); + } // display rows foreach ($rows as $row) {

« previous php.pear.cvs (#55848) next »