Browse Source

opts parsing bugfix

The MMGen Project 1 month ago
parent
commit
212cb2d0fb
2 changed files with 3 additions and 3 deletions
  1. 1 1
      mmgen/data/version
  2. 2 2
      mmgen/opts.py

+ 1 - 1
mmgen/data/version

@@ -1 +1 @@
-15.1.dev2
+15.1.dev3

+ 2 - 2
mmgen/opts.py

@@ -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:]):