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

Commit

Permalink
Merge pull request #72 from o5/feature-option-version
Browse files Browse the repository at this point in the history
Added option --version
  • Loading branch information
JakubOnderka authored Jul 10, 2016
2 parents 6871424 + 5ea2575 commit 1d75387
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
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

0 comments on commit 1d75387

Please sign in to comment.