summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2013-11-04 10:52:15 +0000
committerUrban Müller2013-11-04 10:52:15 +0000
commitf462a52db751268f2591b9ecf27d0cc60a8e5fc3 (patch)
tree6df122f412de3a5ed8896d6a2f54e9b5d7a8f0fa /it.class
parent57baa8ac39d13fdcf3910967af4c0101be178b9a (diff)
downloaditools-f462a52db751268f2591b9ecf27d0cc60a8e5fc3.tar.gz
itools-f462a52db751268f2591b9ecf27d0cc60a8e5fc3.tar.bz2
itools-f462a52db751268f2591b9ecf27d0cc60a8e5fc3.zip
make word Usage: mandatory
Diffstat (limited to 'it.class')
-rw-r--r--it.class2
1 files changed, 2 insertions, 0 deletions
diff --git a/it.class b/it.class
index 3244ea4..509ec3d 100644
--- a/it.class
+++ b/it.class
@@ -715,6 +715,8 @@ static function getopt($helplines)
$mandatoryargs = array();
if ($tmp = trim(it::replace(array("\n.*" => "", "^\S+\s+\S+\s*" => "", "\[.*?\]\s*" => ""), trim($helplines))))
$mandatoryargs = preg_split('/\s+/', $tmp);
+ if ($mandatoryargs && !it::match("Usage:", $helplines))
+ it::error("Usage string must contain 'Usage:'");
foreach (array_slice($_SERVER['argv'], 1) as $arg)
{