From 650cc46157d57ba67932222afcc4578d84906ed5 Mon Sep 17 00:00:00 2001 From: igor Date: Wed, 28 May 2025 16:58:42 +0200 Subject: [PATCH] added processing swtiches in command line mode --- src/APIlite.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/APIlite.php b/src/APIlite.php index 0460714..ebb087b 100644 --- a/src/APIlite.php +++ b/src/APIlite.php @@ -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();