diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -931,9 +931,7 @@ static function getopt($usage, $p = array()) $noopts = true; } - if (!$optionalargs && $result['args']) - it::error("Optional arguments passed to script without optional args in usage"); # FIXME 2020-10 NG merge with normal usage errors below - if ($err || $eat || $result['h'] || $result['help'] || $mandatoryargs) + if ($err || $eat || $result['h'] || $result['help'] || $mandatoryargs || (!$optionalargs && $result['args'])) { if (is_resource($out = $result['h'] || $result['help'] ? STDOUT : STDERR)) fputs($out, trim($usage) . "\n"); |