From 77c825f08b516e3e5acf40d0b744a01ce68635fe Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 28 Dec 2007 15:36:55 -0600 Subject: r26618: Implement -W option support. (This used to be commit e48026b17d682c01eb3343ef35f6e847b18fa297) --- source4/scripting/python/samba/getopt.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4') 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) -- cgit