summaryrefslogtreecommitdiff
path: root/scripts/commandline.inc
diff options
context:
space:
mode:
authorSuper-User <root@xmpp001.controlezvous.ca>2009-06-28 20:15:17 +0000
committerSuper-User <root@xmpp001.controlezvous.ca>2009-06-28 20:15:17 +0000
commitc755970141810a98e08f47c52568f635167e34f1 (patch)
tree2d42a5a4a09508d8a240e297d86ce1e579ec248b /scripts/commandline.inc
parent495c85544a740cd0330e73d9c48ca4b84f3d8e97 (diff)
commandline processing handles errors better
Diffstat (limited to 'scripts/commandline.inc')
-rw-r--r--scripts/commandline.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/commandline.inc b/scripts/commandline.inc
index 4a7757fb9..53b9a490b 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()
{