Allow option values to contain ':'

Instead, check that option keys don't contain ':'. Also change the
failing option test to look for this.

Closes https://github.com/mesonbuild/meson/issues/1454
pull/1511/head
Nirbheek Chauhan 8 years ago
parent 6042e21e25
commit 8ee9365717
  1. 7
      mesonbuild/optinterpreter.py
  2. 2
      test cases/failing/14 invalid option name/meson_options.txt

@ -75,15 +75,16 @@ class OptionInterpreter:
self.cmd_line_options = {}
for o in command_line_options:
if self.subproject != '': # Strip the beginning.
# Ignore options that aren't for this subproject
if not o.startswith(self.sbprefix):
continue
else:
if ':' in o:
continue
try:
(key, value) = o.split('=', 1)
except ValueError:
raise OptionException('Option {!r} must have a value separated by equals sign.'.format(o))
# Ignore subproject options if not fetching subproject options
if self.subproject == '' and ':' in key:
continue
self.cmd_line_options[key] = value
def process(self, option_file):

@ -1 +1 @@
option('invalid/name', type : 'boolean', value : false)
option('invalid:name', type : 'boolean', value : false)

Loading…
Cancel
Save