1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r26618: Implement -W option support.

(This used to be commit e48026b17d)
This commit is contained in:
Jelmer Vernooij 2007-12-28 15:36:55 -06:00 committed by Stefan Metzmacher
parent 0098543d67
commit 77c825f08b

View File

@ -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)