From 784c86d6a506eba2851f24116d7657df75cda28c Mon Sep 17 00:00:00 2001 From: panlatent Date: Thu, 15 Jun 2017 14:10:29 +0800 Subject: [PATCH] Advance list command empty notice --- src/Commands/ListCommand.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Commands/ListCommand.php b/src/Commands/ListCommand.php index c7f03ef..9cbbb74 100644 --- a/src/Commands/ListCommand.php +++ b/src/Commands/ListCommand.php @@ -131,6 +131,11 @@ protected function execute(InputInterface $input, OutputInterface $output) protected function listGroups() { $groups = $this->manager->getGroups(); + if (empty($groups)) { + $this->io->writeln('(empty)'); + return; + } + sort($groups); if ($this->isLong) { foreach ($groups as $group) { @@ -162,6 +167,11 @@ protected function listSites() return $site->isEnable(); }); } + if (empty($sites)) { + $this->io->writeln('(empty)'); + return; + } + sort($sites); if ($this->isLong) { $list = []; @@ -203,6 +213,10 @@ protected function listServers() return $server->getSite()->isEnable(); }); } + if (empty($servers)) { + $this->io->writeln('(empty)'); + return; + } sort($servers); if ($this->isLong) {