Skip to content

Commit

Permalink
feat(tools/kconfig): add menu labels for min config
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdragun authored and movsb committed Dec 1, 2023
1 parent f559c89 commit 768372b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tools/idf_py_actions/core_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ def menuconfig(target_name: str, ctx: Context, args: PropertyDict, style: str) -
args.no_hints = True
build_target(target_name, ctx, args)

def save_defconfig(target_name: str, ctx: Context, args: PropertyDict, menu_labels: bool) -> None:
if menu_labels:
os.environ['ESP_IDF_KCONFIG_MIN_LABELS'] = '1'
else:
# unset variable
os.environ.pop('ESP_IDF_KCONFIG_MIN_LABELS', None)
build_target(target_name, ctx, args)

def fallback_target(target_name: str, ctx: Context, args: PropertyDict) -> None:
"""
Execute targets that are not explicitly known to idf.py
Expand Down Expand Up @@ -491,9 +499,13 @@ def help_and_exit(action: str, ctx: Context, param: List, json_option: bool, add
]
},
'save-defconfig': {
'callback': build_target,
'callback': save_defconfig,
'help': 'Generate a sdkconfig.defaults with options different from the default ones',
'options': global_options
'options': global_options + [{
'names': ['--add-menu-labels'],
'is_flag': True,
'help': 'Add menu labels to minimal config.',
}]
}
}
}
Expand Down

0 comments on commit 768372b

Please sign in to comment.