11
0
Fork 0
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:
Alannah Kearney 2019-05-24 18:06:57 +10:00
commit b89f2a6008
4 changed files with 26 additions and 26 deletions

View file

@ -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