From c755970141810a98e08f47c52568f635167e34f1 Mon Sep 17 00:00:00 2001 From: Super-User Date: Sun, 28 Jun 2009 20:15:17 +0000 Subject: [PATCH] commandline processing handles errors better --- scripts/commandline.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/commandline.inc b/scripts/commandline.inc index 4a7757fb98..53b9a490bc 100644 --- a/scripts/commandline.inc +++ b/scripts/commandline.inc @@ -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() { -- 2.39.5