diff --git a/src/Command/Group/GroupFindCommand.php b/src/Command/Group/GroupFindCommand.php index 38158eb..92d3120 100644 --- a/src/Command/Group/GroupFindCommand.php +++ b/src/Command/Group/GroupFindCommand.php @@ -30,7 +30,24 @@ class GroupFindCommand extends Command $groups = $this->client->findGroups(); - var_dump($groups); + $keys = []; + foreach ($groups as $group) { + $keys = array_merge($keys, array_keys($group)); + } + $keys = array_unique($keys); + + $table = new Table($output); + $table->setHeaders($keys); + $table->setStyle('box'); + foreach ($groups as $group) { + $row = []; + foreach ($keys as $key) { + $row[] = isset($group[$key]) ? json_encode($group[$key]) : null; + } + $table->addRow($row); + } + + $table->render(); return self::SUCCESS; }