added quiet option
This commit is contained in:
parent
d5bdb1bade
commit
ccb3479568
|
@ -26,11 +26,13 @@ require dirname(path: __DIR__) . '/vendor/autoload.php';
|
|||
|
||||
|
||||
$shortOpts = 'v::'; // version
|
||||
$shortOpts = 'q::'; // version
|
||||
$shortOpts .= "V::"; // verbose
|
||||
$shortOpts .= "h::"; // help
|
||||
|
||||
$longOpts = [
|
||||
'version::',
|
||||
'quiet::',
|
||||
'verbose::',
|
||||
'help::'
|
||||
];
|
||||
|
@ -47,6 +49,13 @@ if (array_key_exists(key: 'h', array: $options) || array_key_exists(key: 'help',
|
|||
exit(0);
|
||||
}
|
||||
|
||||
if (array_key_exists(key: 'q', array: $options) || array_key_exists(key: 'quiet', array: $options)) {
|
||||
$quiet = true;
|
||||
} else {
|
||||
$quiet = false;
|
||||
}
|
||||
|
||||
|
||||
if (array_key_exists(key: 'V', array: $options) || array_key_exists(key: 'verbose', array: $options)) {
|
||||
$verbose = true;
|
||||
} else {
|
||||
|
@ -56,8 +65,8 @@ if (array_key_exists(key: 'V', array: $options) || array_key_exists(key: 'verbos
|
|||
$arguments = array_slice(array: $argv, offset: $restIndex);
|
||||
|
||||
try {
|
||||
$app = new BindAPI(verbose: $verbose );
|
||||
$app->runCommand(argumentsCount: count(value: $arguments), arguments: $arguments);
|
||||
$app = new BindAPI(verbose: $verbose, quiet: $quiet);
|
||||
$app->runCommand(arguments: $arguments);
|
||||
|
||||
} catch (DependencyException|NotFoundException|Exception $e) {
|
||||
echo $e->getMessage() . PHP_EOL;
|
||||
|
|
Loading…
Reference in New Issue