A command-line options parser with configurable expects and help auto generation.
A command-line options parser with configurable expects and help auto generation.
There is two kind of arguments :
There is two kind of arguments :
- options (short/long tag) : _-h_ or _--version_
- options (short/long tag) : _-h_ or _--version_
- values : my/path/to/a/file
- values : my/path/to/a/file
## Installation
```
composer require darkelfe14728/commandline
```
### Description
## Description
At first, create a new CommandLine with program name and description. Add options and values by using respectively _addOption_ and _addValue_.
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.
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.
Treat script arguments with _parse_ : return an object of variables.
### Example
## Example
```php
```php
<?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 :
CommandLine provide a generator for command-line of programme. Example :