Skip to content

Commit 257368c

Browse files
committed
Update usage example
1 parent a3e945f commit 257368c

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,28 @@ php vendor/bin/php-db-migration-validator --rule=irreversible migrations/
5050
php vendor/bin/php-db-migration-validator --rule=irreversible app/migrations/ vendor/migrations/
5151
```
5252

53+
### Help
54+
55+
```
56+
$ php vendor/bin/php-db-migration-validator help
57+
PHP DB Migration Validator
58+
--------------------------
59+
by Anton Komarev <[email protected]>
60+
61+
Usage: php-db-migration-validator --rule=<rule> <path>
62+
63+
The following commands are available:
64+
65+
help Shows this usage instructions.
66+
67+
Options:
68+
69+
--rules=<rule> Validates the database migration(s) in the specified <path>.
70+
Exits with code 1 on validation errors, 2 on other errors and 0 on success.
71+
Available rules (at least one should be specified):
72+
- irreversible — ensure if migration file has `down` method and this method throws an Exception.
73+
```
74+
5375
## License
5476

5577
- `PHP DB Migration Validator` package is open-sourced software licensed under the [MIT license](LICENSE) by [Anton Komarev].

bin/php-db-migration-validator

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ Usage: $binaryName --rule=<rule> \B<path>\C
112112
113113
Options:
114114
115-
\Y--rules=<rule>\C Validates the database migration(s) in the specified \G<path>\C are irreversible.
116-
The tool will try to check if migration file has `down` method and this method throws an Exception.
115+
\Y--rules=<rule>\C Validates the database migration(s) in the specified \G<path>\C.
117116
Exits with code 1 on validation errors, 2 on other errors and 0 on success.
118-
\BAt least one rule should be specified.\C
117+
Available rules (\Bat least one should be specified\C):
118+
- \Yirreversible\C — ensure if migration file has `down` method and this method throws an Exception.
119119
120120
EOF
121121
,

0 commit comments

Comments
 (0)