Skip to content

Commit e30afd5

Browse files
committed
Added ability to show version with -V or --version argument
1 parent 0e0503b commit e30afd5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

var-dump-check.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
use JakubOnderka\PhpVarDumpCheck;
33

4+
const VERSION = '0.2';
5+
46
const SUCCESS = 0,
57
WITH_ERRORS = 1,
68
FAILED = 255;
@@ -23,15 +25,14 @@ function showOptions()
2325
--exclude Exclude directory. If you want exclude multiple directory, use
2426
multiple exclude parameters.
2527
--no-colors Disable colors in console output.
28+
-V, --version Show version.
2629
-h, --help Print this help.
2730
<?php
2831
}
2932

30-
/**
31-
* Help
32-
*/
33+
// Help
3334
if (!isset($_SERVER['argv'][1]) || in_array('-h', $_SERVER['argv']) || in_array('--help', $_SERVER['argv'])) { ?>
34-
PHP Var Dump check version 0.2
35+
PHP Var Dump check version <?= VERSION ?>
3536
---------------------------
3637
Usage:
3738
var-dump-check [files or directories]
@@ -40,6 +41,11 @@ function showOptions()
4041
exit;
4142
}
4243

44+
// Version
45+
if (in_array('-V', $_SERVER['argv']) || in_array('--version', $_SERVER['argv'])) {
46+
echo VERSION . PHP_EOL;
47+
exit;
48+
}
4349

4450
$files = array(
4551
__DIR__ . '/../../autoload.php',

0 commit comments

Comments
 (0)