2019-10-03 16:26:44 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
def action_extensions(base_actions, project_path=os.getcwd()):
|
|
|
|
def test_callback(ut_apply_config_name, ctx, args):
|
2021-01-26 02:49:01 +00:00
|
|
|
print('!!! From test_subcommand')
|
2019-10-03 16:26:44 +00:00
|
|
|
|
|
|
|
def test_global_callback(ctx, global_args, tasks):
|
2021-01-26 02:49:01 +00:00
|
|
|
print('!!! From test global callback: %s' % global_args.test_extension_option)
|
2019-10-03 16:26:44 +00:00
|
|
|
|
|
|
|
return {
|
2021-01-26 02:49:01 +00:00
|
|
|
'global_options': [{
|
|
|
|
'names': ['--test-extension-option'],
|
|
|
|
'help': 'Help for option --test-extension-option',
|
|
|
|
'default': 'test',
|
2019-10-03 16:26:44 +00:00
|
|
|
}],
|
2021-01-26 02:49:01 +00:00
|
|
|
'global_action_callbacks': [test_global_callback],
|
|
|
|
'actions': {
|
|
|
|
'test_subcommand': {
|
|
|
|
'callback': test_callback,
|
|
|
|
'help': 'Help for test subcommand.',
|
2019-10-03 16:26:44 +00:00
|
|
|
},
|
2021-01-26 02:49:01 +00:00
|
|
|
'hidden_one': {
|
|
|
|
'callback': test_callback,
|
|
|
|
'hidden': True
|
2019-11-08 16:54:10 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-03 16:26:44 +00:00
|
|
|
}
|