From 555be4ad6ad1e774497bdaf687a3021cda49f372 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Wed, 7 May 2008 15:07:56 +0000 Subject: implented debug argument --- it.class | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/it.class b/it.class index 083ca51..bf9969d 100644 --- a/it.class +++ b/it.class @@ -521,6 +521,7 @@ function getopt($helplines) $witharg[$longoptname ? $longoptname : $shortoptname] = $longoptarg || $shortoptarg; } } + $witharg['debug'] = 1; $mandatoryargs = array(); if ($tmp = trim(it::replace(array("\n.*" => "", "^\S+\s+\S+\s*" => "", "\[.*?\]\s*" => ""), trim($helplines)))) @@ -570,6 +571,15 @@ function getopt($helplines) exit(1); } + if ($result['debug']) + { + foreach (split('[.,]', $result['debug']) as $ultrad) + { + $ultravar = split('[-=:]', $ultrad); + $GLOBALS["debug_$ultravar[0]"] = isset($ultravar[1]) ? $ultravar[1] : 1; + } + } + $GLOBALS['it_stdin']['args'] = $result['args'] ? $result['args'] : array("-"); it::_stdin_next(); -- cgit v1.2.3