mirror of
https://github.com/samba-team/samba.git
synced 2025-02-05 21:57:51 +03:00
samba-tool: Improve getopt.py error handling
Throw an exception when --option value is not in the form "a=b"
This commit is contained in:
parent
0c342f8986
commit
8dbf79941f
@ -75,8 +75,7 @@ class SambaOptions(optparse.OptionGroup):
|
||||
|
||||
def _set_option(self, option, opt_str, arg, parser):
|
||||
if arg.find('=') == -1:
|
||||
print("--option takes a 'a=b' argument")
|
||||
sys.exit(1)
|
||||
raise optparse.OptionValueError("--option option takes a 'a=b' argument")
|
||||
a = arg.split('=')
|
||||
self._lp.set(a[0], a[1])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user