Skip to content

Commit 72d9134

Browse files
committed
Fix getopt options and ensure JSON export fetches all token data
1 parent c11106e commit 72d9134

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libexec/csas-access-token.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Get today's Statements list.
99
*/
10-
$options = getopt('o::e::a::s::t:l:j', ['output::', 'environment::', 'tokenId::', 'list', 'accesTokenKey::', 'sandboxModeKey::', 'json']);
10+
$options = getopt('o::e::a::s::t:l::j::', ['output::', 'environment::', 'tokenId::', 'list', 'accesTokenKey::', 'sandboxModeKey::', 'json']);
1111
\Ease\Shared::init(
1212
['DB_CONNECTION', 'DB_HOST', 'DB_PORT', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD'],
1313
\array_key_exists('environment', $options) ? $options['environment'] : (\array_key_exists('e', $options) ? $options['e'] : '../.env')
@@ -21,7 +21,7 @@
2121

2222
if (isset($options['json']) || isset($options['j'])) {
2323
// Export token list in JSON format
24-
echo json_encode($tokenList, JSON_PRETTY_PRINT);
24+
echo json_encode($tokenList->fetchAll(), JSON_PRETTY_PRINT);
2525
} else {
2626
// Export token list in plain text format
2727
foreach ($tokenList as $tokenData) {

0 commit comments

Comments
 (0)