]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
throw a catchable exception in getUser()
authorEvan Prodromou <evan@status.net>
Tue, 21 Sep 2010 10:12:43 +0000 (06:12 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 21 Sep 2010 10:12:43 +0000 (06:12 -0400)
scripts/commandline.inc

index a29f588448db88f7d048be2d5475ebe9f786874e..6d94a318d65a550d717b6d4030b479dbe6341244 100644 (file)
@@ -178,6 +178,10 @@ function get_option_value($opt, $alt=null)
     return null;
 }
 
+class NoUserArgumentException extends Exception
+{
+}
+
 function getUser()
 {
     $user = null;
@@ -195,8 +199,7 @@ function getUser()
             throw new Exception("Can't find user with nickname '$nickname'");
         }
     } else {
-        show_help();
-        exit(1);
+        throw new NoUserArgumentException("No user argument specified.");
     }
 
     return $user;