From d74dea5b88eb8fffa2c9803c0a4bd645fe7830b5 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Mon, 8 Dec 2008 00:15:51 +0000 Subject: [PATCH] - Only show switch -y if available --- ext/phar/phar/pharcommand.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) { -- 2.50.1