diff --git a/README.md b/README.md index 5403da5..e26bf51 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,28 @@ php vendor/bin/php-db-migration-validator --rule=irreversible migrations/ php vendor/bin/php-db-migration-validator --rule=irreversible app/migrations/ vendor/migrations/ ``` +### Help + +``` +$ php vendor/bin/php-db-migration-validator help +PHP DB Migration Validator +-------------------------- +by Anton Komarev + +Usage: php-db-migration-validator --rule= + + The following commands are available: + + help Shows this usage instructions. + + Options: + + --rules= Validates the database migration(s) in the specified . + Exits with code 1 on validation errors, 2 on other errors and 0 on success. + Available rules (at least one should be specified): + - irreversible — ensure if migration file has `down` method and this method throws an Exception. +``` + ## License - `PHP DB Migration Validator` package is open-sourced software licensed under the [MIT license](LICENSE) by [Anton Komarev]. diff --git a/bin/php-db-migration-validator b/bin/php-db-migration-validator index b53e45c..8dcf1c7 100644 --- a/bin/php-db-migration-validator +++ b/bin/php-db-migration-validator @@ -112,10 +112,10 @@ Usage: $binaryName --rule= \B\C Options: - \Y--rules=\C Validates the database migration(s) in the specified \G\C are irreversible. - The tool will try to check if migration file has `down` method and this method throws an Exception. + \Y--rules=\C Validates the database migration(s) in the specified \G\C. Exits with code 1 on validation errors, 2 on other errors and 0 on success. - \BAt least one rule should be specified.\C + Available rules (\Bat least one should be specified\C): + - \Yirreversible\C — ensure if migration file has `down` method and this method throws an Exception. EOF ,