romannowicki / clix
This package is abandoned and no longer maintained.
The author suggests using the symfony/console package instead.
There is no license information available for the latest version (1.0.0) of this package.
Command line tool for PHP
1.0.0
2014-11-01 09:35 UTC
This package is not auto-updated.
Last update: 2015-07-05 07:27:46 UTC
README
Clix offers user friendly environment for command-line commands that can be used for any recurring task, such as cronjobs, imports, or other batch job.
- mapping command line argument to task variables
- display help message for task when --help parameter will be passed
- optional and required parameters
- default values for parameters
- asking user for input
- allow to hidden user input for confidential data
- by default all task are working in quiet mode to turn on console output --verbose parameter should be used
- options list with default value
- cli progress bar
Installation:
via Composer:
"require": { "romannowicki/clix": "1.0.0" }
Example of usage:
see example code bootstrap Basic task
To display available task list:
$ ./run
No task specified. Select one from below :
--------------------------------------
Basic : Basic example
HelloWord : Example HelloWord task
One/Foo : test example 1
Two/Foo : test example 2
To see help for specyfic task:
$ ./run HelloWord --help
**********************
Example HelloWord task
**********************
usage: ./run HelloWord [options]
options:
--help : Show this help message (default: NULL)
--verbose : Show output log messages (default: NULL)
firstname : Firstname used for output message (MANDATORY)
lastname : Lastname used for output message (MANDATORY)
--uppercase: Print name uppercase (MANDATORY)
MORE:
HelloWord is just an example, self explained.
To run single task:
./run HelloWord firstname=Adam lastname=Smith --uppercase --verbose
Progress Bar Example
$ ./run One/Foo msg=test delay=1 --verbose
29% [###################---------------------------------------] 29/ 100