1. Go to this page and download the library: Download amercier/cli-helpers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
amercier / cli-helpers example snippets
$options = \Cli\Helpers\Parameter::getFromCommandLine(array(
'host' => new Parameter('h', 'host' , '127.0.0.1'),
'username' => new Parameter('u', 'username', Parameter::VALUE_REQUIRED),
'password' => new Parameter('p', 'password', Parameter::VALUE_REQUIRED),
'verbose' => new Parameter('v', 'verbose' , Parameter::VALUE_NO_VALUE),
));
$options['host']; // given -h/--host, or 127.0.0.1 otherwise
$options['username']; // given -u/--username
$options['password']; // given -p/--password
$options['verbose']; // true if -v/--verbose is given, false otherwise