README : add installation section

master
Julien Rosset 5 years ago
parent f5ee0314d3
commit 7f5347046c

@ -1,10 +1,9 @@
# PHPCommandLine
__Command line management library in PHP (CLI)__
![nb releases](https://badgen.net/github/tags/darkelfe14728/PhpCommandLine?label=Nb%20releases)
![last release](https://badgen.net/github/tag/darkelfe14728/PhpCommandLine?label=Last%20release&color=yellow)
![licence](https://badgen.net/badge/license/CC%20BY%204.0/red)
![last release](https://badgen.net/packagist/v/darkelfe14728/commandline?label=Last%20release)
![licence](https://badgen.net/packagist/license/darkelfe14728/commandline?color=red)
![nb releases](https://badgen.net/packagist/dt/darkelfe14728/commandline?color=green)
A command-line options parser with configurable expects and help auto generation.
@ -12,13 +11,18 @@ There is two kind of arguments :
- options (short/long tag) : _-h_ or _--version_
- values : my/path/to/a/file
### Description
## Installation
```
composer require darkelfe14728/commandline
```
## Description
At first, create a new CommandLine with program name and description. Add options and values by using respectively _addOption_ and _addValue_.
Default options for help (-h / --help) and version (--version) can be add with _addDefaultArguments_ and use _treatDefaultArguments_ for launching associated treatments.
Treat script arguments with _parse_ : return an object of variables.
### Example
## Example
```php
<?php
@ -46,7 +50,7 @@ Would display something like that :
}
### Automatic help generation
## Automatic help generation
CommandLine provide a generator for command-line of programme. Example :
Checker

Loading…
Cancel
Save