From 7f25197f10a29c0265d110170d33766069e7715c Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Mon, 14 Mar 2016 17:19:53 +0100 Subject: handle 0 as default value --- it.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'it.class') 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)); -- cgit v1.2.3