Updated README, CHANGELOG, and composer.json for 1.1.5 release

This commit is contained in:
Alannah Kearney 2019-05-24 17:34:09 +10:00
commit 075370c3be
3 changed files with 44 additions and 25 deletions

View file

@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
**View all [Unreleased][] changes here** **View all [Unreleased][] changes here**
## [1.1.5][]
#### Changed
- Updated to work with `pointybeard/helpers-cli-input` v1.1.x
## [1.1.4][] ## [1.1.4][]
#### Changed #### Changed
- Refactoring of `manpage()` to hide 'Options' and/or 'Arguments' if there are none to show. - Refactoring of `manpage()` to hide 'Options' and/or 'Arguments' if there are none to show.
@ -34,7 +38,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
#### Added #### Added
- Initial release - Initial release
[Unreleased]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.4...integration [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
[1.1.4]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.3...1.1.4 [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.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.2]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.1...1.1.2

View file

@ -1,6 +1,6 @@
# PHP Helpers: Command-line Functions # PHP Helpers: Command-line Functions
- Version: v1.1.4 - Version: v1.1.5
- Date: May 24 2019 - Date: May 24 2019
- [Release notes](https://github.com/pointybeard/helpers-functions-cli/blob/master/CHANGELOG.md) - [Release notes](https://github.com/pointybeard/helpers-functions-cli/blob/master/CHANGELOG.md)
- [GitHub repository](https://github.com/pointybeard/helpers-functions-cli) - [GitHub repository](https://github.com/pointybeard/helpers-functions-cli)
@ -60,32 +60,45 @@ var_dump(Cli\get_window_size());
echo Cli\manpage( echo Cli\manpage(
'test', 'test',
'1.0.0', '1.0.1',
'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', '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()) (new Input\InputCollection())
->append(new Input\Types\Argument( ->append(
'action', Input\InputTypeFactory::build('Argument')
Input\AbstractInputType::FLAG_REQUIRED, ->name('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' ->flags(Input\AbstractInputType::FLAG_REQUIRED)
)) ->description('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', ->append(
null, Input\InputTypeFactory::build('IncrementingFlag')
Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_TYPE_INCREMENTING, ->name('v')
'verbosity level. -v (errors only), -vv (warnings and errors), -vvv (everything).', ->flags(Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_TYPE_INCREMENTING)
null, ->description('verbosity level. -v (errors only), -vv (warnings and errors), -vvv (everything).')
0 ->validator(new Input\Validator(
)) function (Input\AbstractInputType $input, Input\AbstractInputHandler $context) {
->append(new Input\Types\Option( // Make sure verbosity level never goes above 3
'd', return min(3, (int)$context->find('v'));
'data', }
Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_VALUE_REQUIRED, ))
'Path to the input JSON data.' )
)), ->append(
Input\InputTypeFactory::build('Option')
->name('P')
->flags(Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_VALUE_OPTIONAL)
->description('Port to use for all connections.')
->default('3306')
)
->append(
Input\InputTypeFactory::build('LongOption')
->name('data')
->short('d')
->flags(Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_VALUE_REQUIRED)
->description('Path to the input JSON data.')
),
Colour::FG_GREEN, Colour::FG_GREEN,
Colour::FG_WHITE, Colour::FG_WHITE,
[ [
'Examples' => 'php -f test.php -- import -vvv -d test.json' 'Examples' => 'php -f test.php -- import -vvv -d test.json',
] ]
).PHP_EOL; ).PHP_EOL;
@ -100,6 +113,7 @@ echo Cli\manpage(
// Options: // Options:
// -v verbosity level. -v (errors only), -vv // -v verbosity level. -v (errors only), -vv
// (warnings and errors), -vvv (everything). // (warnings and errors), -vvv (everything).
// -P Port to use for all connections.
// -d, --data=VALUE Path to the input JSON data. // -d, --data=VALUE Path to the input JSON data.
// //
// Examples: // Examples:

View file

@ -1,6 +1,6 @@
{ {
"name": "pointybeard/helpers-functions-cli", "name": "pointybeard/helpers-functions-cli",
"version": "1.1.4", "version": "1.1.5",
"description": "A collection of functions relating to the command-line", "description": "A collection of functions relating to the command-line",
"homepage": "https://github.com/pointybeard/helpers-functions-cli", "homepage": "https://github.com/pointybeard/helpers-functions-cli",
"license": "MIT", "license": "MIT",
@ -14,7 +14,7 @@
], ],
"require": { "require": {
"php": ">=7.2", "php": ">=7.2",
"pointybeard/helpers-cli-input": "~1", "pointybeard/helpers-cli-input": "~1.1",
"pointybeard/helpers-cli-colour": "~1", "pointybeard/helpers-cli-colour": "~1",
"pointybeard/helpers-functions-strings": "~1.1", "pointybeard/helpers-functions-strings": "~1.1",
"pointybeard/helpers-functions-flags": "~1" "pointybeard/helpers-functions-flags": "~1"