plugins: Invoke setup_parser_common_args explicitly from setup_parser
This allows to define plugins which do not need have any of common args. Move setup_parser_common_args into libkas for this as it now becomes a library function. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
15
kas/kas.py
15
kas/kas.py
@@ -97,20 +97,6 @@ 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=[])
|
||||
parser.add_argument('--force-checkout', action='store_true',
|
||||
help='Always checkout the desired refspec of each '
|
||||
'repository, discarding any local changes')
|
||||
parser.add_argument('--update', action='store_true',
|
||||
help='Pull new upstream changes to the desired '
|
||||
'refspec even if it is already checked out locally')
|
||||
|
||||
|
||||
def kas_get_argparser():
|
||||
"""
|
||||
Creates an argparser for kas with all plugins.
|
||||
@@ -137,7 +123,6 @@ def kas_get_argparser():
|
||||
|
||||
for plugin in plugins.all():
|
||||
plugin_parser = subparser.add_parser(plugin.name, help=plugin.helpmsg)
|
||||
setup_parser_common_args(plugin_parser)
|
||||
plugin.setup_parser(plugin_parser)
|
||||
|
||||
return parser
|
||||
|
Reference in New Issue
Block a user