opts parsing bugfix
This commit is contained in:
parent
d7e3b55e3b
commit
212cb2d0fb
2 changed files with 3 additions and 3 deletions
|
|
@ -1 +1 @@
|
|||
15.1.dev2
|
||||
15.1.dev3
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ def process_uopts(opts_data, opts):
|
|||
if len(arg) == 2:
|
||||
uargs = sys.argv[idx+1:]
|
||||
return
|
||||
opt, parm = arg[2:].split('=') if '=' in arg else (arg[2:], None)
|
||||
opt, parm = arg[2:].split('=', 1) if '=' in arg else (arg[2:], None)
|
||||
if len(opt) < 2:
|
||||
die('CmdlineOptError', f'--{opt}: option name must be at least two characters long')
|
||||
if opt in opts or (opt := get_opt_by_substring(opt, opts)):
|
||||
|
|
@ -66,7 +66,7 @@ def process_uopts(opts_data, opts):
|
|||
die('CmdlineOptError', f'option --{opt} requires no parameter')
|
||||
yield (opts[opt].name, True)
|
||||
else:
|
||||
opt, parm = arg[2:].split('=') if '=' in arg else (arg[2:], None)
|
||||
opt, parm = arg[2:].split('=', 1) if '=' in arg else (arg[2:], None)
|
||||
die('CmdlineOptError', f'--{opt}: unrecognized option')
|
||||
elif arg[0] == '-' and len(arg) > 1:
|
||||
for j, sopt in enumerate(arg[1:]):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue