Skip to content

Commit

Permalink
Show help for --manifest, --sbom, and --composer-lock when the PHAR i…
Browse files Browse the repository at this point in the history
…s used
  • Loading branch information
sebastianbergmann committed Jan 19, 2024
1 parent 8871541 commit 181bef2
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/TextUI/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use const PHP_EOL;
use function count;
use function defined;
use function explode;
use function max;
use function preg_replace_callback;
Expand Down Expand Up @@ -149,7 +150,7 @@ static function ($matches)
*/
private function elements(): array
{
return [
$elements = [
'Usage' => [
['text' => 'phpunit [options] UnitTest [UnitTest.php]'],
['text' => 'phpunit [options] <directory>'],
Expand Down Expand Up @@ -250,13 +251,23 @@ private function elements(): array
['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'],
['arg' => '--cache-result-file=<file>', 'desc' => 'Specify result cache path and filename'],
],
];

'Miscellaneous Options' => [
['arg' => '-h|--help', 'desc' => 'Prints this usage information'],
['arg' => '--version', 'desc' => 'Prints the version and exits'],
['arg' => '--atleast-version <min>', 'desc' => 'Checks that version is greater than min and exits'],
['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version'],
],
if (defined('__PHPUNIT_PHAR__')) {
$elements['PHAR Options'] = [
['arg' => '--manifest', 'desc' => 'Print Software Bill of Materials (SBOM) in plain-text format'],
['arg' => '--sbom', 'desc' => 'Print Software Bill of Materials (SBOM) in CycloneDX XML format'],
['arg' => '--composer-lock', 'desc' => 'Print composer.lock file used to build the PHAR'],
];
}

$elements['Miscellaneous Options'] = [
['arg' => '-h|--help', 'desc' => 'Prints this usage information'],
['arg' => '--version', 'desc' => 'Prints the version and exits'],
['arg' => '--atleast-version <min>', 'desc' => 'Checks that version is greater than min and exits'],
['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version'],
];

return $elements;
}
}

0 comments on commit 181bef2

Please sign in to comment.