diff options
-rw-r--r-- | it.class | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -929,7 +929,8 @@ static function getopt($usage, $p = array()) 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) { - fputs(($result['h'] || $result['help'] ? STDOUT : STDERR), trim($usage) . "\n"); + if (is_resource($out = $result['h'] || $result['help'] ? STDOUT : STDERR)) + fputs($out, trim($usage) . "\n"); return $p['noexit'] ? false : exit(1); } |