]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
commandline processing handles errors better
authorSuper-User <root@xmpp001.controlezvous.ca>
Sun, 28 Jun 2009 20:15:17 +0000 (20:15 +0000)
committerSuper-User <root@xmpp001.controlezvous.ca>
Sun, 28 Jun 2009 20:15:17 +0000 (20:15 +0000)
scripts/commandline.inc

index 4a7757fb98f13e43c47bf55cdd0841da848304fd..53b9a490bc1cc89ca9348e1133eb273d1b37394e 100644 (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()
 {