summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
Diffstat (limited to 'it.class')
-rw-r--r--it.class4
1 files changed, 1 insertions, 3 deletions
diff --git a/it.class b/it.class
index 74c9b7c..744c718 100644
--- a/it.class
+++ b/it.class
@@ -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");