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();