2022-05-23 09:30:13 -04:00
|
|
|
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2019-10-03 12:26:44 -04:00
|
|
|
def action_extensions(base_actions, project_path):
|
|
|
|
def some_callback(ut_apply_config_name, ctx, args):
|
2021-01-25 21:49:01 -05:00
|
|
|
print('!!! From some subcommand')
|
2019-10-03 12:26:44 -04:00
|
|
|
|
|
|
|
def some_global_callback(ctx, global_args, tasks):
|
2021-01-25 21:49:01 -05:00
|
|
|
print('!!! From some global callback: %s' % global_args.some_extension_option)
|
2019-10-03 12:26:44 -04:00
|
|
|
|
|
|
|
return {
|
2021-01-25 21:49:01 -05:00
|
|
|
'global_options': [{
|
|
|
|
'names': ['--some-extension-option'],
|
|
|
|
'help': 'Help for option --some-extension-option',
|
|
|
|
'default': 'test',
|
2019-10-03 12:26:44 -04:00
|
|
|
}],
|
2021-01-25 21:49:01 -05:00
|
|
|
'global_action_callbacks': [some_global_callback],
|
|
|
|
'actions': {
|
|
|
|
'extra_subcommand': {
|
|
|
|
'callback': some_callback,
|
|
|
|
'help': 'Help for some subcommand.',
|
2019-10-03 12:26:44 -04:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|