git.samba.org
/
sfrench
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0c342f8
)
samba-tool: Improve getopt.py error handling
author
Giampaolo Lauria
<lauria2@yahoo.com>
Mon, 17 Oct 2011 19:28:52 +0000
(15:28 -0400)
committer
Jelmer Vernooij
<jelmer@samba.org>
Wed, 19 Oct 2011 01:34:07 +0000
(
03:34
+0200)
Throw an exception when --option value is not in the form "a=b"
source4/scripting/python/samba/getopt.py
patch
|
blob
|
history
diff --git
a/source4/scripting/python/samba/getopt.py
b/source4/scripting/python/samba/getopt.py
index c7035c1936554a63195465fa5c6d95aebf934d56..14cfba62410d2d02545c7d88e80e728223caa2a6 100644
(file)
--- a/
source4/scripting/python/samba/getopt.py
+++ b/
source4/scripting/python/samba/getopt.py
@@
-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])