composer require gevman/interactive-cli
Gevman\Cli\Cli
bool
confirm(string
$prompt [, bool
$default = true])$prompt
- prompt message$default
- default valuevoid
input(&$input [, string
$message = ''] [, bool
$required = false])$prompt
- prompt message$default
- default valueGevman\Cli\CliOutput
output(string
$str [, mixed
$_ = null])$str
- message or pattern for sprintf$_
- parameters for sprintfGevman\Cli\CliOutput
Gevman\Cli\CliOutput
success()Gevman\Cli\CliOutput
warning()Gevman\Cli\CliOutput
error()Gevman\Cli\CliOutput
note()Gevman\Cli\CliOutput
endl()Gevman\Cli\CliOutput
cl()void
progressBar(mixed
$all [, string
$additionalInfo = ''])$all
- count of all$additionalInfo
- displays additional Info for each steprequire '/path/to/autoload.php';
use Gevman\Cli\Cli;
//basic example
Cli::output('%s - %s', 'hello', 'world')->note()->endl()->output('yesimum')->error()->endl()->endl();
//pregressbar example
$all = 100000;
for ($step = 0; $step < 100000; $step++) {
Cli::output($step + 1)->progressBar($all, $step);
}
Comments