diff options
author | Urban Müller | 2013-11-04 10:52:15 +0000 |
---|---|---|
committer | Urban Müller | 2013-11-04 10:52:15 +0000 |
commit | f462a52db751268f2591b9ecf27d0cc60a8e5fc3 (patch) | |
tree | 6df122f412de3a5ed8896d6a2f54e9b5d7a8f0fa | |
parent | 57baa8ac39d13fdcf3910967af4c0101be178b9a (diff) | |
download | itools-f462a52db751268f2591b9ecf27d0cc60a8e5fc3.tar.gz itools-f462a52db751268f2591b9ecf27d0cc60a8e5fc3.tar.bz2 itools-f462a52db751268f2591b9ecf27d0cc60a8e5fc3.zip |
make word Usage: mandatory
-rw-r--r-- | it.class | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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) { |