Add --json to polls list and polls show
CI / Deploy / PHP 8.5 (push) Successful in 1m37s
CI / Deploy / PHP 8.4 (push) Successful in 1m39s
CI / Deploy / test (push) Successful in 2s
CI / Deploy / deploy (push) Skipped

Machine-readable output for scripts; never contains the admin token
unless --link is given.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Sonnet 5.5 committed 2026-11-16 13:59:38 +01:00
1 parent 664088e139
commit 3d6ade668f
6 files changed
+115 -2

No files matched your search

+10
View File
@@ -37,6 +37,10 @@ class PollsListCommand extends PollsCommand
->addOption('email', [
'help' => __('Nur Umfragen, deren E-Mail-Adresse diesen Text enthält.'),
])
->addOption('json', [
'help' => __('Ausgabe als JSON statt als Tabelle (für Skripte).'),
'boolean' => true,
])
->addOption('sort', [
'help' => __('Sortierung (aufsteigend).'),
'default' => 'created',
@@ -75,6 +79,12 @@ class PollsListCommand extends PollsCommand
});
}
if ($args->getOption('json')) {
$this->printJson($io, array_map($this->pollData(...), $polls));
return static::CODE_SUCCESS;
}
if ($polls === []) {
$io->out(__('Keine Umfragen gefunden.'));