cli : add a "-q" option to not display the return code
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2730 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
12
cli.php
12
cli.php
@@ -13,8 +13,12 @@ class cli
|
||||
require ("domframework/cli.php");
|
||||
$cli = new cli;
|
||||
$cli->run(); */
|
||||
/** The expert mode allow to see/execute the models */
|
||||
private $EXPERT = false;
|
||||
|
||||
/** Quiet mode don't display empty results */
|
||||
private $QUIET;
|
||||
|
||||
public function __construct ()
|
||||
{
|
||||
// Catch the trigger_errors and display them politely
|
||||
@@ -90,6 +94,13 @@ class cli
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->QUIET = FALSE;
|
||||
if (isset ($argv[0]) && $argv[0] === "-q")
|
||||
{
|
||||
$this->QUIET = true;
|
||||
array_shift ($argv);
|
||||
}
|
||||
|
||||
$this->EXPERT = FALSE;
|
||||
if (isset ($argv[0]) && $argv[0] === "-expert")
|
||||
{
|
||||
@@ -346,6 +357,7 @@ class cli
|
||||
$r = $classReflection->newInstanceArgs($paramConst);
|
||||
$r->auth["email"] = "cli";
|
||||
$s = call_user_func_array(array($r, $method), $argv);
|
||||
if ($this->QUIET === false || $s !== "" && $s !== array () && $s !== null)
|
||||
var_dump ($s);
|
||||
}
|
||||
catch (Exception $e)
|
||||
|
||||
Reference in New Issue
Block a user