diversen / minimal-cli-framework
A very fast and simple CLI framework
Requires
Requires (Dev)
- phpunit/phpunit: ^10.0
- dev-main
- v7.1.0
- v7.0.7
- v7.0.6
- v7.0.5
- v7.0.4
- v7.0.3
- v7.0.2
- v7.0.1
- v7.0.0
- v6.1.4
- v6.1.3
- v6.1.2
- v6.1.1
- v6.1.0
- v6.0.3
- v6.0.2
- v6.0.0
- v5.0.1
- v5.0.0
- v4.1.1
- v4.1.0
- v4.0.9
- v4.0.8
- v4.0.7
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.1.0
- v3.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.1.17
- v1.1.16
- v1.1.15
- v1.1.14
- v1.1.12
- v1.1.11
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
This package is auto-updated.
Last update: 2024-11-05 14:27:18 UTC
README
A simple CLI framework with options for multiple sub-commands
loaded as classes. In order to implement a command into an
exisiting class you will just need to add two methods: getCommand
and
runCommand
- and then add the object or the class to an instance
of the class MinimalCli
.
Install:
composer require diversen/minimal-cli-framework
Example usage
src/EchoTest.php is a command class
containing a single command echo
and a couple of options.
This command is added to a simple program in demos/example.php
In order to get help on the usage of the command echo
:
php demos/example.php echo --help
Put a file in uppercase:
php demos/example.php echo --up README.md
Or (shorthand):
php demos/example.php echo -u README.md
Which also will output the file in uppercase
Utils
Some common CLI Utils.
php demos/utils_test.php
Colors are supported with https://github.com/php-parallel-lint/PHP-Console-Color
License: MIT