From 5ea2575fc4cd18866c4f0661e306051c25cee6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Bugy=C3=ADk?= Date: Tue, 7 Jun 2016 17:33:40 +0200 Subject: [PATCH] Added option --version --- README.md | 1 + parallel-lint.php | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c5a709d..47c177b1 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ For colored output install the suggested package `jakub-onderka/php-console-high - `--stdin` Load files and folder to test from standard input. - `--ignore-fails` Ignore failed tests. - `-h, --help` Print this help. +- `-V, --version` Display this application version ## Recommended setting for usage with Symfony framework diff --git a/parallel-lint.php b/parallel-lint.php index 660f58f8..9b121014 100644 --- a/parallel-lint.php +++ b/parallel-lint.php @@ -6,7 +6,8 @@ die(255); } -const SUCCESS = 0, +const VERSION = '0.9.2', + SUCCESS = 0, WITH_ERRORS = 1, FAILED = 255; @@ -34,13 +35,19 @@ function showOptions() --stdin Load files and folder to test from standard input. --ignore-fails Ignore failed tests. -h, --help Print this help. + -V, --version Display this application version -PHP Parallel Lint version 0.9.1 ------------------------------- Usage: parallel-lint [sa] [-p php] [-e ext] [-j num] [--exclude dir] [files or directories] @@ -54,6 +61,11 @@ function showUsage() showUsage(); } +if (in_array('-V', $_SERVER['argv']) || in_array('--version', $_SERVER['argv'])) { + showVersion(); + die(); +} + $files = array( __DIR__ . '/../../autoload.php', __DIR__ . '/vendor/autoload.php'