diff options
author | Urban Müller | 2016-10-03 14:46:20 +0200 |
---|---|---|
committer | Urban Müller | 2016-10-03 14:46:20 +0200 |
commit | c2d75b17317c49873a7b4332aef7bdd03489b1ad (patch) | |
tree | 4fa6c71b4fe9dd5e8b40ab4b5d1d22fc7fb9020f | |
parent | 86be744386d1b2b7ecb3dee7cf4274bd1a4ea9f0 (diff) | |
download | itools-c2d75b17317c49873a7b4332aef7bdd03489b1ad.tar.gz itools-c2d75b17317c49873a7b4332aef7bdd03489b1ad.tar.bz2 itools-c2d75b17317c49873a7b4332aef7bdd03489b1ad.zip |
support ultragetopt
-rw-r--r-- | it.class | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -727,6 +727,7 @@ static function imageconvert($p) * Parse command line options with Usage given as template and return assoc array. * @param $usage Usage parsed to determine options, example see below. * @param $p['optbeforearg'] Stop parsing options when first argument is encountered + * @param $p['noexit'] Just return false in case of help or bad usage * @return Associative array of options, key 'args' for optional non-option args * * Usage: myprogram.php [OPTIONS] PATTERN [MOREARGS] @@ -840,7 +841,7 @@ static function getopt($usage, $p = array()) if ($err || $eat || $result['h'] || $result['help'] || $mandatoryargs) { fputs(($result['h'] || $result['help'] ? STDOUT : STDERR), trim($usage) . "\n"); - exit(1); + return $p['noexit'] ? false : exit(1); } if ($result['debug']) |