From 4c33ccfc234eb5edaffe2f1681cff3fe5333bced Mon Sep 17 00:00:00 2001 From: Alannah Kearney Date: Sat, 25 May 2019 14:29:34 +1000 Subject: [PATCH] Updated composer.json, README, and CHANGELOG for 1.1.6 release --- CHANGELOG.md | 9 +++++++-- README.md | 11 ++++++++--- composer.json | 5 +++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98a333d..6655c1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). **View all [Unreleased][] changes here** +## [1.1.6][] +#### Added +- Added `display_error_and_exit` function + ## [1.1.5][] #### Changed - Updated to work with `pointybeard/helpers-cli-input` v1.1.x @@ -38,8 +42,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). #### Added - Initial release -[Unreleased]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.5...integration -[1.1.5]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.5...1.1.5 +[Unreleased]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.6...integration +[1.1.6]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.5...1.1.6 +[1.1.5]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.4...1.1.5 [1.1.4]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.3...1.1.4 [1.1.3]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.2...1.1.3 [1.1.2]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.1...1.1.2 diff --git a/README.md b/README.md index d861e1f..357e10a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # PHP Helpers: Command-line Functions -- Version: v1.1.5 -- Date: May 24 2019 +- Version: v1.1.6 +- Date: May 25 2019 - [Release notes](https://github.com/pointybeard/helpers-functions-cli/blob/master/CHANGELOG.md) - [GitHub repository](https://github.com/pointybeard/helpers-functions-cli) @@ -33,6 +33,7 @@ The following functions are provided: - `usage(string $name, Cli\Input\InputCollection $collection) : string` - `manpage(string $name, string $version, string $description, Input\InputCollection $collection, $foregroundColour=Colour\Colour::FG_DEFAULT, $headingColour=Colour\Colour::FG_WHITE, array $additional=[]): string` - `get_window_size(): array` +- `display_error_and_exit($message, $heading = 'Error', $background = Colour\Colour::BG_RED): void` Example usage: @@ -77,7 +78,7 @@ echo Cli\manpage( ->validator(new Input\Validator( function (Input\AbstractInputType $input, Input\AbstractInputHandler $context) { // Make sure verbosity level never goes above 3 - return min(3, (int)$context->find('v')); + return min(3, (int) $context->find('v')); } )) ) @@ -119,6 +120,10 @@ echo Cli\manpage( // Examples: // php -f test.php -- import -vvv -d test.json +Cli\display_error_and_exit('Looks like something went wrong!', 'Fatal Error'); +// Fatal Error +// Looks like something went wrong! + ``` ## Support diff --git a/composer.json b/composer.json index 49423c6..9ee7234 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "pointybeard/helpers-functions-cli", - "version": "1.1.5", + "version": "1.1.6", "description": "A collection of functions relating to the command-line", "homepage": "https://github.com/pointybeard/helpers-functions-cli", "license": "MIT", @@ -17,7 +17,8 @@ "pointybeard/helpers-cli-input": "~1.1", "pointybeard/helpers-cli-colour": "~1", "pointybeard/helpers-functions-strings": "~1.1", - "pointybeard/helpers-functions-flags": "~1" + "pointybeard/helpers-functions-flags": "~1", + "pointybeard/helpers-functions-arrays": "~1" }, "require-dev": { "phpunit/phpunit": "^8"