Skip to content

Commit 460515d

Browse files
authored
New JBZoo/Cli (#10)
See the project homepage: https://github.com/JBZoo/Cli
1 parent 23fc58a commit 460515d

File tree

10 files changed

+539
-256
lines changed

10 files changed

+539
-256
lines changed

.phan.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
'directory_list' => [
2222
'src',
2323

24+
'vendor/jbzoo/cli/src',
2425
'vendor/jbzoo/data/src',
2526
'vendor/jbzoo/utils/src',
2627
'vendor/jbzoo/mermaid-php/src',

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,35 +49,35 @@ prepare-one-example:
4949
@php `pwd`/composer-graph \
5050
--root="$(TEST_PATH)" \
5151
--output="$(PATH_BUILD)/$(OUTPUT)-minimal.html" \
52-
-vvv
52+
-vvv --profile
5353
@php `pwd`/composer-graph \
5454
--root="$(TEST_PATH)" \
5555
--output="$(PATH_BUILD)/$(OUTPUT)-extensions.html" \
5656
--show-ext \
57-
-vvv
57+
-vvv --profile
5858
@php `pwd`/composer-graph \
5959
--root="$(TEST_PATH)" \
6060
--output="$(PATH_BUILD)/$(OUTPUT)-versions.html" \
6161
--show-link-versions \
6262
--show-package-versions \
63-
-vvv
63+
-vvv --profile
6464
@php `pwd`/composer-graph \
6565
--root="$(TEST_PATH)" \
6666
--output="$(PATH_BUILD)/$(OUTPUT)-suggests.html" \
6767
--show-suggests \
68-
-vvv
68+
-vvv --profile
6969
@php `pwd`/composer-graph \
7070
--root="$(TEST_PATH)" \
7171
--output="$(PATH_BUILD)/$(OUTPUT)-suggests-versions.html" \
7272
--show-link-versions \
7373
--show-package-versions \
7474
--show-suggests \
75-
-vvv
75+
-vvv --profile
7676
@php `pwd`/composer-graph \
7777
--root="$(TEST_PATH)" \
7878
--output="$(PATH_BUILD)/$(OUTPUT)-dev.html" \
7979
--show-dev \
80-
-vvv
80+
-vvv --profile
8181
@php `pwd`/composer-graph \
8282
--root="$(TEST_PATH)" \
8383
--output="$(PATH_BUILD)/$(OUTPUT)-full-without-php.html" \
@@ -86,4 +86,4 @@ prepare-one-example:
8686
--show-suggests \
8787
--show-link-versions \
8888
--show-package-versions \
89-
-vvv
89+
-vvv --profile

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ Options:
3535
-l, --show-link-versions Show version requirements in links
3636
-P, --show-package-versions Show version of packages
3737
-O, --abc-order Strict ABC ordering nodes in graph. It's fine tuning, sometimes it useful.
38+
--no-progress Disable progress bar animation for logs
39+
--mute-errors Mute any sort of errors. So exit code will be always "0" (if it's possible).
40+
It has major priority then --non-zero-on-error. It's on your own risk!
41+
--stdout-only For any errors messages application will use StdOut instead of StdErr. It's on your own risk!
42+
--non-zero-on-error None-zero exit code on any StdErr message
43+
--timestamp Show timestamp at the beginning of each message
44+
--profile Display timing and memory usage information
3845
-h, --help Display help for the given command. When no command is given display help for the build command
3946
-q, --quiet Do not output any message
4047
-V, --version Display this application version

composer-graph.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515

1616
declare(strict_types=1);
1717

18-
use JBZoo\ComposerGraph\CommandBuild;
19-
use Symfony\Component\Console\Application;
18+
namespace JBZoo\ComposerGraph;
2019

21-
define('PATH_ROOT', __DIR__);
20+
use JBZoo\Cli\CliApplication;
21+
22+
const PATH_ROOT = __DIR__;
2223

2324
$vendorPaths = [
2425
__DIR__ . '/../../autoload.php',
@@ -27,15 +28,15 @@
2728
];
2829

2930
foreach ($vendorPaths as $file) {
30-
if (file_exists($file)) {
31-
define('JBZOO_COMPOSER_GRAPH', $file);
31+
if (\file_exists($file)) {
32+
\define('JBZOO_AUTOLOAD_FILE', $file);
3233
break;
3334
}
3435
}
3536

36-
require JBZOO_COMPOSER_GRAPH;
37+
require_once JBZOO_AUTOLOAD_FILE;
3738

38-
$application = new Application('JBZoo/Composer-Graph', '@git-version@');
39-
$application->add(new CommandBuild());
39+
$application = new CliApplication('JBZoo/CI-Report-Converter', '@git-version@');
40+
$application->registerCommandsByPath(__DIR__ . '/src/Commands', __NAMESPACE__);
4041
$application->setDefaultCommand('build');
4142
$application->run();

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"jbzoo/data" : "^4.3.0",
2323
"jbzoo/mermaid-php" : "^2.3.0",
2424
"jbzoo/utils" : "^4.5.1",
25+
"jbzoo/cli" : "^1.0.0",
2526

2627
"symfony/console" : ">=4.4"
2728
},

0 commit comments

Comments
 (0)