kas: De-duplicate common plugin args

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Paul Barker
2020-06-15 22:03:28 +02:00
committed by Jan Kiszka
parent a37d72ea7c
commit f0094af79f
3 changed files with 8 additions and 10 deletions

View File

@@ -100,6 +100,13 @@ def _atexit_handler():
loop.close()
def setup_parser_common_args(parser):
parser.add_argument('config',
help='Config file')
parser.add_argument('--skip',
help='Skip build steps',
default=[])
def kas_get_argparser():
"""
Creates an argparser for kas with all plugins.
@@ -122,6 +129,7 @@ def kas_get_argparser():
for plugin in getattr(kasplugin, 'plugins', []):
plugin_parser = subparser.add_parser(plugin.name, help=plugin.helpmsg)
setup_parser_common_args(plugin_parser)
plugin.setup_parser(plugin_parser)
return parser