mirror of
https://github.com/n3w/helpers-cli-input.git
synced 2025-12-19 12:43:23 +00:00
Updated README, CHANGELOG, example/example.php, and composer.json for 1.1.1 release
This commit is contained in:
parent
96bf279a70
commit
b89f2a6008
4 changed files with 26 additions and 26 deletions
|
|
@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
**View all [Unreleased][] changes here**
|
||||
|
||||
## [1.1.1][]
|
||||
#### Changed
|
||||
- `AbstractInputHandler::find()` returns NULL if it cannot find any input with the supplied name. It is easier to test for NULL than it is to catch an exception.
|
||||
|
||||
## [1.1.0][]
|
||||
#### Added
|
||||
- Expanded input types to include `Flag`, `IncrementingFlag`, and `LongOption`.
|
||||
|
|
@ -30,7 +34,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
#### Added
|
||||
- Initial release
|
||||
|
||||
[Unreleased]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.0...integration
|
||||
[Unreleased]: https://github.com/pointybeard/helpers-functions-cli/compare/1.1.1...integration
|
||||
[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.3...1.1.0
|
||||
[1.0.3]: https://github.com/pointybeard/helpers-functions-cli/compare/1.0.2...1.0.3
|
||||
[1.0.2]: https://github.com/pointybeard/helpers-functions-cli/compare/1.0.1...1.0.2
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# PHP Helpers: Command-line Input and Input Type Handlers
|
||||
|
||||
- Version: v1.1.0
|
||||
- Version: v1.1.1
|
||||
- Date: May 24 2019
|
||||
- [Release notes](https://github.com/pointybeard/helpers-cli-input/blob/master/CHANGELOG.md)
|
||||
- [GitHub repository](https://github.com/pointybeard/helpers-cli-input)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "pointybeard/helpers-cli-input",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"description": "Collection of classes for handling argv (and other) input when calling command-line scripts. Helps with parsing, collecting and validating arguments, options, and flags.",
|
||||
"homepage": "https://github.com/pointybeard/helpers-cli-input",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -92,31 +92,26 @@ echo Cli\manpage(
|
|||
// Examples:
|
||||
// php -f example/example.php -- -vvvs -d example/example.json import
|
||||
|
||||
try{
|
||||
|
||||
var_dump($argv->find('action'));
|
||||
// string(6) "import"
|
||||
var_dump($argv->find('action'));
|
||||
// string(6) "import"
|
||||
|
||||
var_dump($argv->find('v'));
|
||||
//int(3)
|
||||
var_dump($argv->find('v'));
|
||||
//int(3)
|
||||
|
||||
var_dump($argv->find('s'));
|
||||
//bool(true)
|
||||
var_dump($argv->find('s'));
|
||||
//bool(true)
|
||||
|
||||
var_dump($argv->find('data'));
|
||||
// class stdClass#11 (1) {
|
||||
// public $fruit =>
|
||||
// array(2) {
|
||||
// [0] =>
|
||||
// string(5) "apple"
|
||||
// [1] =>
|
||||
// string(6) "banana"
|
||||
// }
|
||||
// }
|
||||
var_dump($argv->find('data'));
|
||||
// class stdClass#11 (1) {
|
||||
// public $fruit =>
|
||||
// array(2) {
|
||||
// [0] =>
|
||||
// string(5) "apple"
|
||||
// [1] =>
|
||||
// string(6) "banana"
|
||||
// }
|
||||
// }
|
||||
|
||||
var_dump($argv->find('nope-doesnt-exist'));
|
||||
|
||||
} catch(\Exception $ex) {
|
||||
echo "Error: " . $ex->getMessage() . PHP_EOL;
|
||||
}
|
||||
//Error trying to access input. Returned: Input nope-doesnt-exist could not be found.
|
||||
var_dump($argv->find('nope-doesnt-exist'));
|
||||
// NULL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue