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:
parent
a37d72ea7c
commit
f0094af79f
@ -58,8 +58,6 @@ class Build:
|
|||||||
Setup the argument parser for the build plugin
|
Setup the argument parser for the build plugin
|
||||||
"""
|
"""
|
||||||
|
|
||||||
parser.add_argument('config',
|
|
||||||
help='Config file')
|
|
||||||
parser.add_argument('extra_bitbake_args',
|
parser.add_argument('extra_bitbake_args',
|
||||||
nargs='*',
|
nargs='*',
|
||||||
help='Extra arguments to pass to bitbake')
|
help='Extra arguments to pass to bitbake')
|
||||||
@ -68,9 +66,6 @@ class Build:
|
|||||||
help='Select target to build')
|
help='Select target to build')
|
||||||
parser.add_argument('-c', '--cmd', '--task', dest='task',
|
parser.add_argument('-c', '--cmd', '--task', dest='task',
|
||||||
help='Select which task should be executed')
|
help='Select which task should be executed')
|
||||||
parser.add_argument('--skip',
|
|
||||||
help='Skip build steps',
|
|
||||||
default=[])
|
|
||||||
|
|
||||||
def run(self, args):
|
def run(self, args):
|
||||||
"""
|
"""
|
||||||
|
@ -100,6 +100,13 @@ def _atexit_handler():
|
|||||||
loop.close()
|
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():
|
def kas_get_argparser():
|
||||||
"""
|
"""
|
||||||
Creates an argparser for kas with all plugins.
|
Creates an argparser for kas with all plugins.
|
||||||
@ -122,6 +129,7 @@ def kas_get_argparser():
|
|||||||
|
|
||||||
for plugin in getattr(kasplugin, 'plugins', []):
|
for plugin in getattr(kasplugin, 'plugins', []):
|
||||||
plugin_parser = subparser.add_parser(plugin.name, help=plugin.helpmsg)
|
plugin_parser = subparser.add_parser(plugin.name, help=plugin.helpmsg)
|
||||||
|
setup_parser_common_args(plugin_parser)
|
||||||
plugin.setup_parser(plugin_parser)
|
plugin.setup_parser(plugin_parser)
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
@ -56,11 +56,6 @@ class Shell:
|
|||||||
Setup the argument parser for the shell plugin
|
Setup the argument parser for the shell plugin
|
||||||
"""
|
"""
|
||||||
|
|
||||||
parser.add_argument('config',
|
|
||||||
help='Config file')
|
|
||||||
parser.add_argument('--skip',
|
|
||||||
help='Skip build steps',
|
|
||||||
default=[])
|
|
||||||
parser.add_argument('-k', '--keep-config-unchanged',
|
parser.add_argument('-k', '--keep-config-unchanged',
|
||||||
help='Skip steps that change the configuration',
|
help='Skip steps that change the configuration',
|
||||||
action='store_true')
|
action='store_true')
|
||||||
|
Loading…
Reference in New Issue
Block a user