From: Marcus Boerger Date: Mon, 8 Dec 2008 00:15:51 +0000 (+0000) Subject: - Only show switch -y if available X-Git-Tag: php-5.4.0alpha1~191^2~4872 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d74dea5b88eb8fffa2c9803c0a4bd645fe7830b5;p=php - Only show switch -y if available --- diff --git a/ext/phar/phar/pharcommand.inc b/ext/phar/phar/pharcommand.inc index cbca587e35..005e84ef02 100755 --- a/ext/phar/phar/pharcommand.inc +++ b/ext/phar/phar/pharcommand.inc @@ -139,7 +139,7 @@ class PharCommand extends CLICommand 'y' => array( 'typ' => 'privkey', 'val' => NULL, - 'inf' => 'Private key for OpenSSL signing.', + 'inf' => ' Private key for OpenSSL signing.', ), ); @@ -157,6 +157,9 @@ class PharCommand extends CLICommand $hash_optional = array('SHA-256' => 'SHA256', 'SHA-512' => 'SHA512', 'OpenSSL' => 'OpenSSL'); + if (!in_array('OpenSSL', $hash_avail)) { + unset($phar_args['y']); + } foreach($hash_optional as $key => $name) { if (in_array($key, $hash_avail)) { @@ -378,7 +381,7 @@ class PharCommand extends CLICommand * @param string $arg The phar selection * @param string $cfg The config option. * @param string $key The key information. - * @return string $arg The selected algorithm + * @return string $arg The private key. */ static function cli_arg_typ_privkey($arg, $cfg, $key) {