Skip to content

Commit 8199c49

Browse files
jrfnlgrogy
authored andcommitted
Docs: show all options in help and README
This commit syncs the three lists of the supported options: * The processing of received arguments in the `Application` class. * The CLI help in the `Settings` class. * The options shown in the README. I have verified that: * The options in all three lists are now in the same order to make future maintenance more straight-forward. Includes having all functional short options at the top of the lists. * All options are now shown in the help and the README. * The descriptions in the help and in the README are complete and largely the same (minus the "further reading" links shown in the README). Includes: * Fixing a typo in the help `-asp` vs `--asp`. * Line length management for the CLI help. * Minor grammatical improvement. Fixes 81
1 parent 183f82a commit 8199c49

File tree

3 files changed

+38
-33
lines changed

3 files changed

+38
-33
lines changed

README.md

+20-19
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,26 @@ It is strongly recommended for existing users of the (unmaintained)
6767

6868
## Command line options
6969

70-
- `-p <php>` Specify PHP-CGI executable to run (default: 'php').
71-
- `-s, --short` Set short_open_tag to On (default: Off).
72-
- `-a, --asp` Set asp_tags to On (default: Off).
73-
- `-e <ext>` Check only files with selected extensions separated by comma. (default: php,php3,php4,php5,phtml,phpt)
74-
- `--exclude` Exclude a file or directory. If you want exclude multiple items, use multiple exclude parameters.
75-
- `-j <num>` Run <num> jobs in parallel (default: 10).
76-
- `--colors` Force enable colors in console output.
77-
- `--no-colors` Disable colors in console output.
78-
- `--no-progress` Disable progress in console output.
79-
- `--checkstyle` Output results as Checkstyle XML.
80-
- `--json` Output results as JSON string (requires PHP 5.4).
81-
- `--gitlab` Output results for the GitLab Code Quality widget (requires PHP 5.4), see more in [Code Quality](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html) documentation.
82-
- `--blame` Try to show git blame for row with error.
83-
- `--git <git>` Path to Git executable to show blame message (default: 'git').
84-
- `--stdin` Load files and folder to test from standard input.
85-
- `--ignore-fails` Ignore failed tests.
86-
- `--syntax-error-callback` File with syntax error callback for ability to modify error, see more in [example](doc/syntax-error-callback.md)
87-
- `-h, --help` Print this help.
88-
- `-V, --version` Display this application version.
70+
- `-p <php>` Specify PHP-CGI executable to run (default: 'php').
71+
- `-s`, `--short` Set short_open_tag to On (default: Off).
72+
- `-a`, `--asp` Set asp_tags to On (default: Off).
73+
- `-e <ext>` Check only files with selected extensions separated by comma. (default: php,php3,php4,php5,phtml,phpt)
74+
- `-j <num>` Run <num> jobs in parallel (default: 10).
75+
- `--exclude` Exclude a file or directory. If you want exclude multiple items, use multiple exclude parameters.
76+
- `--colors` Enable colors in console output. (disables auto detection of color support)
77+
- `--no-colors` Disable colors in console output.
78+
- `--no-progress` Disable progress in console output.
79+
- `--checkstyle` Output results as Checkstyle XML.
80+
- `--json` Output results as JSON string (requires PHP 5.4).
81+
- `--gitlab` Output results for the GitLab Code Quality Widget (requires PHP 5.4), see more in [Code Quality](https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html) documentation..
82+
- `--blame` Try to show git blame for row with error.
83+
- `--git <git>` Path to Git executable to show blame message (default: 'git').
84+
- `--stdin` Load files and folder to test from standard input.
85+
- `--ignore-fails` Ignore failed tests.
86+
- `--show-deprecated` Show deprecations (default: Off).
87+
- `--syntax-error-callback` File with syntax error callback for ability to modify error, see more in [example](doc/syntax-error-callback.md).
88+
- `-h`, `--help` Print this help.
89+
- `-V`, `--version` Display the application version
8990

9091

9192
## Recommended excludes for Symfony framework

src/Application.php

+10-6
Original file line numberDiff line numberDiff line change
@@ -77,25 +77,29 @@ private function showOptions()
7777
Options:
7878
-p <php> Specify PHP-CGI executable to run (default: 'php').
7979
-s, --short Set short_open_tag to On (default: Off).
80-
-a, -asp Set asp_tags to On (default: Off).
80+
-a, --asp Set asp_tags to On (default: Off).
8181
-e <ext> Check only files with selected extensions separated by comma.
8282
(default: php,php3,php4,php5,phtml,phpt)
83+
-j <num> Run <num> jobs in parallel (default: 10).
8384
--exclude Exclude a file or directory. If you want exclude multiple items,
8485
use multiple exclude parameters.
85-
-j <num> Run <num> jobs in parallel (default: 10).
86-
--colors Enable colors in console output. (disables auto detection of color support)
86+
--colors Enable colors in console output.
87+
(disables auto detection of color support)
8788
--no-colors Disable colors in console output.
8889
--no-progress Disable progress in console output.
89-
--json Output results as JSON string.
90-
--gitlab Output results for the GitLab Code Quality Widget.
9190
--checkstyle Output results as Checkstyle XML.
91+
--json Output results as JSON string
92+
(requires PHP 5.4).
93+
--gitlab Output results for the GitLab Code Quality Widget
94+
(requires PHP 5.4).
9295
--blame Try to show git blame for row with error.
9396
--git <git> Path to Git executable to show blame message (default: 'git').
9497
--stdin Load files and folder to test from standard input.
9598
--ignore-fails Ignore failed tests.
99+
--show-deprecated Show deprecations (default: Off).
96100
--syntax-error-callback File with syntax error callback for ability to modify error
97101
-h, --help Print this help.
98-
-V, --version Display this application version
102+
-V, --version Display the application version
99103
100104
HELP;
101105
}

src/Settings.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ public static function parseArguments(array $arguments)
152152
$settings->aspTags = true;
153153
break;
154154

155-
case '--exclude':
156-
$settings->excluded[] = $arguments->getNext();
157-
break;
158-
159155
case '-e':
160156
$settings->extensions = array_map('trim', explode(',', $arguments->getNext()));
161157
break;
@@ -164,6 +160,10 @@ public static function parseArguments(array $arguments)
164160
$settings->parallelJobs = max((int) $arguments->getNext(), 1);
165161
break;
166162

163+
case '--exclude':
164+
$settings->excluded[] = $arguments->getNext();
165+
break;
166+
167167
case '--colors':
168168
$settings->colors = self::FORCED;
169169
break;
@@ -176,6 +176,10 @@ public static function parseArguments(array $arguments)
176176
$settings->showProgress = false;
177177
break;
178178

179+
case '--checkstyle':
180+
$settings->format = self::FORMAT_CHECKSTYLE;
181+
break;
182+
179183
case '--json':
180184
$settings->format = self::FORMAT_JSON;
181185
break;
@@ -184,10 +188,6 @@ public static function parseArguments(array $arguments)
184188
$settings->format = self::FORMAT_GITLAB;
185189
break;
186190

187-
case '--checkstyle':
188-
$settings->format = self::FORMAT_CHECKSTYLE;
189-
break;
190-
191191
case '--git':
192192
$settings->gitExecutable = $arguments->getNext();
193193
break;

0 commit comments

Comments
 (0)