diff options
author | Tomas V.V.Cox <cox@php.net> | 2002-04-10 12:23:31 +0000 |
---|---|---|
committer | Tomas V.V.Cox <cox@php.net> | 2002-04-10 12:23:31 +0000 |
commit | 3788b31b0eaae1d26bc6b718ad1a092bb512ede2 (patch) | |
tree | 8cdbfe0b28f3d9a2fd273c0db63c2ba57201b15f | |
parent | 297ee300de2e4e48f146f7c5954345aaed8b12db (diff) | |
download | php-git-3788b31b0eaae1d26bc6b718ad1a092bb512ede2.tar.gz |
Added "pear package -n" (only output the created package file name)
-rw-r--r-- | pear/PEAR/Command/Package.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/pear/PEAR/Command/Package.php b/pear/PEAR/Command/Package.php index eb2d9771b2..4d102bc0fe 100644 --- a/pear/PEAR/Command/Package.php +++ b/pear/PEAR/Command/Package.php @@ -89,9 +89,11 @@ class PEAR_Command_Package extends PEAR_Command_Common { switch ($command) { case 'package': - return array('[<package.xml>]', + return array('[-n] [<package.xml>]', 'Creates a PEAR package from its description file (usually '. - 'named as package.xml)'); + "named as package.xml)\n". + " -n Return only the created package file name. Useful for\n". + " shell script operations."); case 'package-list': return array('<pear package>', 'List the contents of a PEAR package'); @@ -146,6 +148,14 @@ class PEAR_Command_Package extends PEAR_Command_Common $result = $packager->Package($pkginfofile, $compress); $output = ob_get_contents(); ob_end_clean(); + if (PEAR::isError($result)) { + $failmsg = $result; + } + // Don't want output, only the package file name just created + if (isset($options['n'])) { + $this->ui->displayLine($result); + return; + } $lines = explode("\n", $output); foreach ($lines as $line) { $this->ui->displayLine($line); |