coredata: encapsulate destination name

This means that there are no special args passed ot builtin args
anymore.
pull/3243/head
Dylan Baker 7 years ago
parent bbf71d9aa3
commit 1452eb73c1
  1. 6
      mesonbuild/coredata.py
  2. 4
      mesonbuild/mesonmain.py

@ -367,6 +367,12 @@ def get_builtin_option_action(optname):
return 'store_true'
return None
def get_builtin_option_destination(optname):
optname = optname.replace('-', '_')
if optname == 'warnlevel':
return 'warning_level'
return optname
def get_builtin_option_default(optname, prefix='', noneIfSuppress=False):
if is_builtin_option(optname):
o = builtin_options[optname]

@ -26,7 +26,7 @@ from .wrap import WrapMode, wraptool
default_warning = '1'
def add_builtin_argument(p, name, **kwargs):
k = kwargs.get('dest', name.replace('-', '_'))
k = coredata.get_builtin_option_destination(name)
c = coredata.get_builtin_option_choices(k)
b = coredata.get_builtin_option_action(k)
h = coredata.get_builtin_option_description(k)
@ -65,7 +65,7 @@ def create_parser():
add_builtin_argument(p, 'werror')
add_builtin_argument(p, 'layout')
add_builtin_argument(p, 'default-library')
add_builtin_argument(p, 'warnlevel', dest='warning_level')
add_builtin_argument(p, 'warnlevel')
add_builtin_argument(p, 'stdsplit')
add_builtin_argument(p, 'errorlogs')
p.add_argument('--cross-file', default=None,

Loading…
Cancel
Save