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

py/getopt: improve messages for bad --debug arg

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall
2022-08-19 16:49:24 +12:00
committed by Douglas Bagnall
parent ca7535912b
commit 604832b8ff

View File

@@ -67,7 +67,10 @@ class SambaOptions(optparse.OptionGroup):
self._configfile = arg
def _set_debuglevel(self, option, opt_str, arg, parser):
self._lp.set('debug level', arg)
try:
self._lp.set('debug level', arg)
except RuntimeError:
raise OptionError(f"invalid -d/--debug value: '{arg}'")
parser.values.debuglevel = arg
def _set_realm(self, option, opt_str, arg, parser):