commandline processing handles errors better

This commit is contained in:
Super-User 2009-06-28 20:15:17 +00:00
parent 495c85544a
commit c755970141
1 changed files with 8 additions and 1 deletions

View File

@ -63,7 +63,14 @@ if (isset($longoptions)) {
$parser = new Console_Getopt();
list($options, $args) = $parser->getopt($argv, $shortoptions, $longoptions);
$result = $parser->getopt($argv, $shortoptions, $longoptions);
if (PEAR::isError($result)) {
print $result->getMessage()."\n";
exit(1);
} else {
list($options, $args) = $result;
}
function show_help()
{