summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Gass2016-03-14 17:19:53 +0100
committerNathan Gass2016-03-14 17:19:53 +0100
commit7f25197f10a29c0265d110170d33766069e7715c (patch)
tree31613f8e1a71f1589064f22359ccb1ec0c35537b
parent737df0101a7a9b1846b3859c8578d1d870092968 (diff)
downloaditools-7f25197f10a29c0265d110170d33766069e7715c.tar.gz
itools-7f25197f10a29c0265d110170d33766069e7715c.tar.bz2
itools-7f25197f10a29c0265d110170d33766069e7715c.zip
handle 0 as default value
-rw-r--r--it.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it.class b/it.class
index b533c3f..fa881ff 100644
--- a/it.class
+++ b/it.class
@@ -770,7 +770,7 @@ static function getopt($usage, $p = array())
list($shortoptname, $shortoptarg) = $matches;
}
- if ($default = it::match('\[(.*)\]\s*$', $usageline))
+ if (($default = it::match('\[(.*)\]\s*$', $usageline)) !== null)
{
if ($longoptarg || $shortoptarg)
$defaults[$longoptname ? $longoptname : $shortoptname] = it::replace(array('^default:?\s*' => ""), trim($default));