Updated README and CHANGELOG for 1.1.3 release

This commit is contained in:
Alannah Kearney 2019-05-24 13:20:08 +10:00
commit 627406241e
2 changed files with 31 additions and 19 deletions

View file

@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
**View all [Unreleased][] changes here**
## [1.1.3][]
#### Changed
- Updated `manpage()` to include `foregroundColour`, `headingColour`, and `additional` arguments. Removed `example` argument in favour of including it inside `additional`.
- Added `pointybeard/helpers-cli-colour` composer package
## [1.1.2][]
#### Changed
- Using latest version of `pointybeard/helpers-functions-strings`
@ -25,6 +30,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
#### Added
- Initial release
[Unreleased]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.1...integration
[Unreleased]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.3...integration
[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
[1.1.1]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/pointybeard/helpers-functions-cli/compare/1.0.0...1.1.0

View file

@ -1,7 +1,7 @@
# PHP Helpers: Command-line Functions
- Version: v1.1.2
- Date: May 23 2019
- Version: v1.1.3
- Date: May 24 2019
- [Release notes](https://github.com/pointybeard/helpers-functions-cli/blob/master/CHANGELOG.md)
- [GitHub repository](https://github.com/pointybeard/helpers-functions-cli)
@ -18,9 +18,9 @@ And run composer to update your dependencies:
### Requirements
This library makes use of the [PHP Helpers: Command-line Input and Input Type Handlers](https://github.com/pointybeard/helpers-cli-input), [PHP Helpers: Flag Functions](https://github.com/pointybeard/helpers-functions-flags) (`pointybeard/helpers-functions-flags`) and [PHP Helpers: String Functions](https://github.com/pointybeard/helpers-functions-strings) packages. They are installed automatically via composer.
This library makes use of the [PHP Helpers: Command-line Input and Input Type Handlers](https://github.com/pointybeard/helpers-cli-input), [PHP Helpers: Flag Functions](https://github.com/pointybeard/helpers-functions-flags) (`pointybeard/helpers-functions-flags`), [PHP Helpers: Command-line Colour](https://github.com/pointybeard/helpers-cli-colours) (`pointybeard/helpers-cli-colours`) and [PHP Helpers: String Functions](https://github.com/pointybeard/helpers-functions-strings) packages. They are installed automatically via composer.
To include all the [PHP Helpers](https://github.com/pointybeard/helpers) packages on your project, use `composer require pointybeard/helpers` or add `"pointybeard/helpers": "~1.1"` to your composer file.
To include all the [PHP Helpers](https://github.com/pointybeard/helpers) packages on your project, use `composer require pointybeard/helpers` or add `"pointybeard/helpers": "~1"` to your composer file.
## Usage
@ -43,6 +43,7 @@ declare(strict_types=1);
include __DIR__.'/vendor/autoload.php';
use pointybeard\Helpers\Cli\Input;
use pointybeard\Helpers\Cli\Colour\Colour;
use pointybeard\Helpers\Functions\Cli;
var_dump(Cli\can_invoke_bash());
@ -60,13 +61,12 @@ var_dump(Cli\get_window_size());
echo Cli\manpage(
'test',
'1.0.0',
'A simple test command',
'php -f test.php -- import -vvv -d test.json',
'A simple test command with a really long description. This is an intentionally very long argument description so we can check that word wrapping is working correctly. It should wrap to the window',
(new Input\InputCollection())
->append(new Input\Types\Argument(
'action',
Input\AbstractInputType::FLAG_REQUIRED,
'The name of the action to perform'
'The name of the action to perform. This is an intentionally very long argument description so we can check that word wrapping is working correctly'
))
->append(new Input\Types\Option(
'v',
@ -80,22 +80,27 @@ echo Cli\manpage(
'd',
'data',
Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_VALUE_REQUIRED,
'Path to the input JSON data'
))
'Path to the input JSON data.'
)),
Colour::FG_GREEN,
Colour::FG_WHITE,
[
'Examples' => 'php -f test.php -- import -vvv -d test.json'
]
).PHP_EOL;
// test 1.0.0, A simple test command
// test 1.0.0, A simple test command with a really long description. This is an intentionally very long argument description so we can check that word wrapping is working correctly. It should wrap to the window
// Usage: test [OPTIONS]... ACTION...
//
// Mandatory values for long options are mandatory for short options too.
//
// Arguments:
// ACTION The name of the action to perform
// ACTION The name of the action to perform. This is an
// intentionally very long argument description so we can check
// that word wrapping is working correctly
//
// Options:
// -v verbosity level. -v (errors only), -vv (warnings
// and errors), -vvv (everything).
// -d, --data=VALUE Path to the input JSON data
// -v verbosity level. -v (errors only), -vv
// (warnings and errors), -vvv (everything).
// -d, --data=VALUE Path to the input JSON data.
//
// Examples:
// php -f test.php -- import -vvv -d test.json