mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
jwutils.Options: Increase option parsing error verbosity
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
82c0e6fe2e
commit
9dd957c9d3
1 changed files with 7 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import json
|
|||
from collections import OrderedDict
|
||||
from .log import *
|
||||
import shlex
|
||||
import traceback
|
||||
|
||||
class Options: # export
|
||||
|
||||
|
|
@ -39,7 +40,12 @@ class Options: # export
|
|||
if r is not None:
|
||||
return r
|
||||
r = cls()
|
||||
opt_strs = shlex.split(opts_str)
|
||||
try:
|
||||
opt_strs = shlex.split(opts_str)
|
||||
except Exception as e:
|
||||
slog_m(ERR, traceback.format_exc())
|
||||
slog(ERR, 'Failed to split options string >{}<'.format(opts_str))
|
||||
raise
|
||||
for opt_str in opt_strs:
|
||||
opt_str = re.sub('\s*=\s*', '=', opt_str)
|
||||
sides = opt_str.split('=')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue