r26628: python: Add more documentation, simplify code in Samba3 module.
[ab/samba.git/.git] / source4 / scripting / python / samba / getopt.py
index 014dd336d848e96a934c26fa1702bb245f3c84c6..c0e70530626eec5e1003dc82503ff613fe160eed 100644 (file)
@@ -42,17 +42,23 @@ class CredentialsOptions(optparse.OptionGroup):
                         help="Password", type=str, callback=self.set_password)
         self.add_option("-U", "--username", metavar="USERNAME", 
                         action="callback", type=str,
-                        help="username", callback=self.parse_username)
+                        help="Username", callback=self.parse_username)
+        self.add_option("-W", "--workgroup", metavar="WORKGROUP", 
+                        action="callback", type=str,
+                        help="Workgroup", callback=self.parse_workgroup)
         self.creds = Credentials()
 
     def parse_username(self, option, opt_str, arg, parser):
         self.creds.parse_string(arg)
 
+    def parse_workgroup(self, option, opt_str, arg, parser):
+        self.creds.set_domain(arg)
+
     def set_password(self, option, opt_str, arg, parser):
         self.creds.set_password(arg)
 
     def set_simple_bind_dn(self, option, opt_str, arg, parser):
-        self.creds.set_simple_bind_dn(arg)
+        self.creds.set_bind_dn(arg)
 
     def get_credentials(self):
         return self.creds