summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-28 15:36:55 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-28 09:42:01 -0600
commit77c825f08b516e3e5acf40d0b744a01ce68635fe (patch)
tree977e20bc1e2aedb17fe354b6d6d9bc04da95b175
parent0098543d676d29385857cc2998304d0270a98813 (diff)
downloadsamba-77c825f08b516e3e5acf40d0b744a01ce68635fe.tar.gz
samba-77c825f08b516e3e5acf40d0b744a01ce68635fe.tar.bz2
samba-77c825f08b516e3e5acf40d0b744a01ce68635fe.zip
r26618: Implement -W option support.
(This used to be commit e48026b17d682c01eb3343ef35f6e847b18fa297)
-rw-r--r--source4/scripting/python/samba/getopt.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py
index 014dd336d8..87cf171ca2 100644
--- a/source4/scripting/python/samba/getopt.py
+++ b/source4/scripting/python/samba/getopt.py
@@ -42,12 +42,18 @@ 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)