Skip to content

Commit

Permalink
New JBZoo/Cli (#10)
Browse files Browse the repository at this point in the history
See the project homepage: https://github.com/JBZoo/Cli
  • Loading branch information
SmetDenis authored Apr 12, 2022
1 parent 23fc58a commit 460515d
Show file tree
Hide file tree
Showing 10 changed files with 539 additions and 256 deletions.
1 change: 1 addition & 0 deletions .phan.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'directory_list' => [
'src',

'vendor/jbzoo/cli/src',
'vendor/jbzoo/data/src',
'vendor/jbzoo/utils/src',
'vendor/jbzoo/mermaid-php/src',
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,35 @@ prepare-one-example:
@php `pwd`/composer-graph \
--root="$(TEST_PATH)" \
--output="$(PATH_BUILD)/$(OUTPUT)-minimal.html" \
-vvv
-vvv --profile
@php `pwd`/composer-graph \
--root="$(TEST_PATH)" \
--output="$(PATH_BUILD)/$(OUTPUT)-extensions.html" \
--show-ext \
-vvv
-vvv --profile
@php `pwd`/composer-graph \
--root="$(TEST_PATH)" \
--output="$(PATH_BUILD)/$(OUTPUT)-versions.html" \
--show-link-versions \
--show-package-versions \
-vvv
-vvv --profile
@php `pwd`/composer-graph \
--root="$(TEST_PATH)" \
--output="$(PATH_BUILD)/$(OUTPUT)-suggests.html" \
--show-suggests \
-vvv
-vvv --profile
@php `pwd`/composer-graph \
--root="$(TEST_PATH)" \
--output="$(PATH_BUILD)/$(OUTPUT)-suggests-versions.html" \
--show-link-versions \
--show-package-versions \
--show-suggests \
-vvv
-vvv --profile
@php `pwd`/composer-graph \
--root="$(TEST_PATH)" \
--output="$(PATH_BUILD)/$(OUTPUT)-dev.html" \
--show-dev \
-vvv
-vvv --profile
@php `pwd`/composer-graph \
--root="$(TEST_PATH)" \
--output="$(PATH_BUILD)/$(OUTPUT)-full-without-php.html" \
Expand All @@ -86,4 +86,4 @@ prepare-one-example:
--show-suggests \
--show-link-versions \
--show-package-versions \
-vvv
-vvv --profile
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ Options:
-l, --show-link-versions Show version requirements in links
-P, --show-package-versions Show version of packages
-O, --abc-order Strict ABC ordering nodes in graph. It's fine tuning, sometimes it useful.
--no-progress Disable progress bar animation for logs
--mute-errors Mute any sort of errors. So exit code will be always "0" (if it's possible).
It has major priority then --non-zero-on-error. It's on your own risk!
--stdout-only For any errors messages application will use StdOut instead of StdErr. It's on your own risk!
--non-zero-on-error None-zero exit code on any StdErr message
--timestamp Show timestamp at the beginning of each message
--profile Display timing and memory usage information
-h, --help Display help for the given command. When no command is given display help for the build command
-q, --quiet Do not output any message
-V, --version Display this application version
Expand Down
17 changes: 9 additions & 8 deletions composer-graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@

declare(strict_types=1);

use JBZoo\ComposerGraph\CommandBuild;
use Symfony\Component\Console\Application;
namespace JBZoo\ComposerGraph;

define('PATH_ROOT', __DIR__);
use JBZoo\Cli\CliApplication;

const PATH_ROOT = __DIR__;

$vendorPaths = [
__DIR__ . '/../../autoload.php',
Expand All @@ -27,15 +28,15 @@
];

foreach ($vendorPaths as $file) {
if (file_exists($file)) {
define('JBZOO_COMPOSER_GRAPH', $file);
if (\file_exists($file)) {
\define('JBZOO_AUTOLOAD_FILE', $file);
break;
}
}

require JBZOO_COMPOSER_GRAPH;
require_once JBZOO_AUTOLOAD_FILE;

$application = new Application('JBZoo/Composer-Graph', '@git-version@');
$application->add(new CommandBuild());
$application = new CliApplication('JBZoo/CI-Report-Converter', '@git-version@');
$application->registerCommandsByPath(__DIR__ . '/src/Commands', __NAMESPACE__);
$application->setDefaultCommand('build');
$application->run();
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"jbzoo/data" : "^4.3.0",
"jbzoo/mermaid-php" : "^2.3.0",
"jbzoo/utils" : "^4.5.1",
"jbzoo/cli" : "^1.0.0",

"symfony/console" : ">=4.4"
},
Expand Down
Loading

0 comments on commit 460515d

Please sign in to comment.