- Align output of info command

This commit is contained in:
Marcus Boerger 2007-05-15 15:41:03 +00:00
parent 85e02bbee8
commit 580a5cf2ea

View File

@ -591,15 +591,16 @@ class PharCommand extends CLICommand
$phar = $this->args['f']['val']; $phar = $this->args['f']['val'];
$hash = $phar->getsignature(); $hash = $phar->getsignature();
$infos = array();
if (!$hash) if (!$hash)
{ {
echo "Hash: NONE\n"; $infos['Hash'] = 'NONE';
} }
else else
{ {
echo "Hash Type: ${hash['hash_type']}\n"; $infos['Hash Type'] = $hash['hash_type'];
echo "Hash: ${hash['hash']}\n"; $infos['Hash'] = $hash['hash'];
} }
$csize = 0; $csize = 0;
@ -626,10 +627,20 @@ class PharCommand extends CLICommand
} }
} }
echo "Entries: $count\n"; $infos['Entries'] = $count;
echo "Compressed: $ccount\n"; $infos['Compressed'] = $ccount;
echo "Uncompressed: $ucount\n"; $infos['Uncompressed'] = $ucount;
echo "Metadata: $mcount\n"; $infos['Metadata'] = $mcount;
$l = 0;
foreach($infos as $which => $val)
{
$l = max(strlen($which), $l);
}
foreach($infos as $which => $val)
{
echo $which . ':' . str_repeat(' ', $l + 1 - strlen($which)) . $val . "\n";
}
} }
} }