Skip to content
Browse files

scripts: add helpers to west build for getting config options

These will be used more in a later patch.

Signed-off-by: Marti Bolivar <>
  • Loading branch information...
mbolivar authored and nashif committed May 4, 2019
1 parent 69099e3 commit d15950353dd440ef156d933188f36f0c30402df7
Showing with 7 additions and 1 deletion.
  1. +7 −1 scripts/west_commands/
@@ -54,6 +54,12 @@
cmake_opt Extra options to pass to CMake; implies -c

def config_get(option, fallback):
return config.get('build', option, fallback=fallback)

def config_getboolean(option, fallback):
return config.getboolean('build', option, fallback=fallback)

class AlwaysIfMissing(argparse.Action):

def __call__(self, parser, namespace, values, option_string=None):
@@ -149,7 +155,7 @@ def do_run(self, args, remainder):
pristine = args.pristine
# Load the pristine={auto, always, never} configuration value
pristine = config.get('build', 'pristine', fallback='never')
pristine = config_get('pristine', 'never')
if pristine not in ['auto', 'always', 'never']:
'treating unknown build.pristine value "{}" as "never"'.

0 comments on commit d159503

Please sign in to comment.
You can’t perform that action at this time.