mirror of
https://github.com/n3w/helpers-functions-cli.git
synced 2025-12-19 12:43:22 +00:00
Updated README, CHANGELOG, and composer.json for 1.1.5 release
This commit is contained in:
parent
f40e14845e
commit
075370c3be
3 changed files with 44 additions and 25 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
56
README.md
56
README.md
|
|
@ -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(
|
||||||
|
Input\InputTypeFactory::build('IncrementingFlag')
|
||||||
|
->name('v')
|
||||||
|
->flags(Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_TYPE_INCREMENTING)
|
||||||
|
->description('verbosity level. -v (errors only), -vv (warnings and errors), -vvv (everything).')
|
||||||
|
->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'));
|
||||||
|
}
|
||||||
))
|
))
|
||||||
->append(new Input\Types\Option(
|
)
|
||||||
'v',
|
->append(
|
||||||
null,
|
Input\InputTypeFactory::build('Option')
|
||||||
Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_TYPE_INCREMENTING,
|
->name('P')
|
||||||
'verbosity level. -v (errors only), -vv (warnings and errors), -vvv (everything).',
|
->flags(Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_VALUE_OPTIONAL)
|
||||||
null,
|
->description('Port to use for all connections.')
|
||||||
0
|
->default('3306')
|
||||||
))
|
)
|
||||||
->append(new Input\Types\Option(
|
->append(
|
||||||
'd',
|
Input\InputTypeFactory::build('LongOption')
|
||||||
'data',
|
->name('data')
|
||||||
Input\AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_VALUE_REQUIRED,
|
->short('d')
|
||||||
'Path to the input JSON data.'
|
->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:
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue