From 4c5e06011b462e655e4cb47e25f6ca27247e903a Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 13 Oct 2015 16:03:44 +0000 Subject: [PATCH] cli : if no controller or models exists, return nothing in listonly mode (bash_completion) git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2361 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- cli.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cli.php b/cli.php index 427fa50..13f54d7 100644 --- a/cli.php +++ b/cli.php @@ -102,9 +102,17 @@ class cli if ($this->EXPERT) $files = array_merge ($files, glob ("models/*.php")); if (count ($files) === 0 && $this->EXPERT === FALSE) + { + if (isset ($argv[0]) && $argv[0] === "-listonly") + exit; die ("No controllers available in ".getcwd()."\n"); + } if (count ($files) === 0 && $this->EXPERT === TRUE) + { + if (isset ($argv[0]) && $argv[0] === "-listonly") + exit; die ("No controllers/models available in ".getcwd()."\n"); + } foreach ($files as $file) { if (strpos ($file, "_"))