diff --git a/cli.php b/cli.php index efdf6fd..b4f2b06 100644 --- a/cli.php +++ b/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,7 +357,8 @@ class cli $r = $classReflection->newInstanceArgs($paramConst); $r->auth["email"] = "cli"; $s = call_user_func_array(array($r, $method), $argv); - var_dump ($s); + if ($this->QUIET === false || $s !== "" && $s !== array () && $s !== null) + var_dump ($s); } catch (Exception $e) {