kas: Simplify setup of plugin argument parsers
By defining the plugin name and help message as attributes of the plugin class we can move the argument parser creation up into the kas_get_argparser() function. This will allow us to further reduce duplication in following commits. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
@@ -121,7 +121,8 @@ def kas_get_argparser():
|
||||
ext_plugin.load()
|
||||
|
||||
for plugin in getattr(kasplugin, 'plugins', []):
|
||||
plugin.get_argparser(subparser)
|
||||
plugin_parser = subparser.add_parser(plugin.name, help=plugin.helpmsg)
|
||||
plugin.setup_parser(plugin_parser)
|
||||
|
||||
return parser
|
||||
|
||||
|
Reference in New Issue
Block a user