Download the PHP package amercier/cli-helpers without Composer
On this page you can find all versions of the php package amercier/cli-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amercier/cli-helpers
More information about amercier/cli-helpers
Files in amercier/cli-helpers
Package cli-helpers
Short Description Utility classes to write PHP command-line scripts
License ISC
Homepage https://github.com/amercier/php-cli-helpers
Informations about the package cli-helpers
php-cli-helpers
Utility classes to write PHP command-line scripts
Installation
php-cli-helpers is available through Composer.
If you are not familiar with Composer, please read the full installation intructions.
Usage
\Cli\Helpers\Parameter
Utility class to handle command-line parameters.
See API Documentation for Parameter
\Cli\Helpers\Script and \Cli\Helpers\DocumentedScript
Utility class to write scripts as objects.
While Script
doesn't have any pre-configured switch, DocumentedScript
has
--h, --help
and -V, --version
. This provides an automatic handling of this
two switches.
Version example:
test-documented-script.php -V
Help example:
test-documented-script.php -h
\Cli\Helpers\Job
Utility class to run a job and catch exceptions.
On successful jobs:
On unsuccessful jobs:
You can also add parameters to the function:
See API Documentation for Job
\Cli\Helpers\IO
Utility class to handle standard input/output.
IO::form
Usage
will display:
Then, user is asked to make a choice between 1 and 3 on standard input.
IO::strPadAll
will display:
See API Documentation for IO
Contributing
Contributions (issues ♥, pull requests ♥♥♥) are more than welcome! Feel free to clone, fork, modify, extend, etc, as long as you respect the license terms.
See contributing intructions for details.
Licensing
This project is released under ISC License license. If this license does not fit your requirement for whatever reason, but you would be interested in using the work (as defined below) under another license, please contact authors.