-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse-clear-groups.php
More file actions
35 lines (26 loc) · 859 Bytes
/
Copy pathparse-clear-groups.php
File metadata and controls
35 lines (26 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env php
<?php
declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use ProPresenter\Parser\ClearGroupsFileReader;
if ($argc < 2) {
echo "Usage: parse-clear-groups.php <ClearGroups>\n";
exit(1);
}
$filePath = $argv[1];
try {
$library = ClearGroupsFileReader::read($filePath);
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
exit(1);
}
$groups = $library->getGroups();
echo "ClearGroups (" . count($groups) . "):\n";
foreach ($groups as $index => $group) {
$number = $index + 1;
$name = $group->getName();
$displayName = $name === '' ? '(unnamed)' : $name;
$uuid = $group->getUuid();
$colorPart = $group->getColorHex() ?? '(no tint)';
echo sprintf(" [%d] %s :: %s :: image_type=%d :: %s\n", $number, $displayName, $uuid, $group->getImageType(), $colorPart);
}