Don't spit out Python love when wrong arguments are given, better
[mirror/userdir-ldap.git] / ud-host
diff --git a/ud-host b/ud-host
index c90b8e6..0fa035a 100755 (executable)
--- a/ud-host
+++ b/ud-host
@@ -213,8 +213,14 @@ User = pwd.getpwuid(os.getuid())[0];
 BindUser = User;
 ListMode = 0
 FingerPrints = 0
+Host = None
 # Process options
-(options, arguments) = getopt.getopt(sys.argv[1:], "nh:a:rlf")
+try:
+   (options, arguments) = getopt.getopt(sys.argv[1:], "nh:a:rlf")
+except getopt.GetoptError, data:
+   print data
+   sys.exit(1)
+
 for (switch, val) in options:
    if (switch == '-h'):
       Host = val;