diff --git a/composer.lock b/composer.lock index 6dae05e..b741b22 100644 --- a/composer.lock +++ b/composer.lock @@ -594,7 +594,7 @@ "source": { "type": "git", "url": "../slotdb-client-php", - "reference": "f3d6e3e7b3a8daa3111e27407f13ba8c56bf997f" + "reference": "bee9457d9da382621e3cc99ffd4b75af443ad27b" }, "require": { "psr/http-client": "^1.0" @@ -620,7 +620,7 @@ } ], "description": "SlotDB PHP Client", - "time": "2025-03-13T18:11:29+00:00" + "time": "2025-03-13T23:31:13+00:00" }, { "name": "symfony/console", diff --git a/src/Command/Group/GroupShowCommand.php b/src/Command/Group/GroupShowCommand.php index 208c3f9..e96efd6 100644 --- a/src/Command/Group/GroupShowCommand.php +++ b/src/Command/Group/GroupShowCommand.php @@ -22,15 +22,27 @@ class GroupShowCommand extends Command protected function configure() { - + $this->addArgument("group", InputArgument::REQUIRED, "Group to display"); } protected function execute(InputInterface $input, OutputInterface $output): int { + $groupId = $input->getArgument("group"); + + $group = $this->client->queryGroup($groupId); - $groups = $this->client->findGroups(); + $len = 2 + max(array_map(mb_strlen(...), array_keys($group))); - var_dump($groups); + foreach ($group as $k=>$v) { + $output->writeln( + sprintf( + str_starts_with($k,"_") + ? "%{$len}s: %s" + : "%{$len}s: %s", + $k, json_encode($v) + ) + ); + } return self::SUCCESS; }