Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Added option --version #72

Merged
merged 1 commit into from
Jul 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions parallel-lint.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
die(255);
}

const SUCCESS = 0,
const VERSION = '0.9.2',
SUCCESS = 0,
WITH_ERRORS = 1,
FAILED = 255;

Expand Down Expand Up @@ -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
}

function showVersion()
{
echo 'PHP Parallel Lint version ' . VERSION . PHP_EOL;
}

function showUsage()
{
showVersion();
?>
PHP Parallel Lint version 0.9.1
-------------------------------
Usage:
parallel-lint [sa] [-p php] [-e ext] [-j num] [--exclude dir] [files or directories]
Expand All @@ -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'
Expand Down