added processing swtiches in command line mode

This commit is contained in:
Igor Miňo 2025-05-28 16:58:42 +02:00
parent ab7bd57362
commit 650cc46157

View File

@ -27,9 +27,11 @@ class APIlite
if (isset($_REQUEST['action'])) {
$this->doAction($_REQUEST['action']);
} else {
if (isset($_REQUEST['format']) && $_REQUEST['format'] == 'html') {
global $argv;
$switches = array_map('strtolower', $argv);
if ((isset($_REQUEST['format']) && $_REQUEST['format'] == 'html') || in_array('--html', $switches)) {
$this->printHelpHTML();
} elseif (isset($_REQUEST['format']) && $_REQUEST['format'] == 'typescript') {
} elseif ((isset($_REQUEST['format']) && $_REQUEST['format'] == 'typescript') || in_array('--typescript', $switches)) {
$this->printHelpTypescript();
} else {
$this->printHelpJSON();