Skip to content

Commit dbbd6ab

Browse files
Daniel BerthereauDaniel Berthereau
authored andcommitted
Hidden secret in help.
1 parent f12af64 commit dbbd6ab

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

_scripts/update_data.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@
153153
echo "Usage: php update_data.php [--option[=value]] ...\n";
154154
echo "Options (defaults shown): \n";
155155
foreach ($options as $k => $v) {
156-
$disp = is_bool($v) ? ($v ? 'true' : 'false') : (is_array($v) ? implode(',', $v) : (string) $v);
156+
// Never print secrets, only whether they are set.
157+
if ($k === 'token') {
158+
$disp = implode(',', array_map(fn ($t) => $t ? '***' : '', $v));
159+
} else {
160+
$disp = is_bool($v) ? ($v ? 'true' : 'false') : (is_array($v) ? implode(',', $v) : (string) $v);
161+
}
157162
echo sprintf(" --%s=%s\n", $k, $disp);
158163
}
159164
echo "Aliases: --json-only, --no-search, --no-update, --only-type=, --only-addon=, --format-csv-only\n";

0 commit comments

Comments
 (0)