diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/image/help.py | 18 | ||||
-rwxr-xr-x | scripts/wic | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py index adfe9767166..ce42627cdb1 100644 --- a/scripts/lib/image/help.py +++ b/scripts/lib/image/help.py @@ -28,6 +28,7 @@ import subprocess import logging +from wic.plugin import pluginmgr, PLUGIN_TYPES def subcommand_error(args): logging.info("invalid subcommand %s" % args[0]) @@ -55,6 +56,23 @@ def wic_help(args, usage_str, subcommands): print(usage_str) +def get_wic_plugins_help(): + """ + Combine wic_plugins_help with the help for every known + source plugin. + """ + result = wic_plugins_help + for plugin_type in PLUGIN_TYPES: + result += '\n\n%s PLUGINS\n\n' % plugin_type.upper() + for name, plugin in pluginmgr.get_plugins(plugin_type).iteritems(): + result += "\n %s plugin:\n" % name + if plugin.__doc__: + result += plugin.__doc__ + else: + result += "\n %s is missing docstring\n" % plugin + return result + + def invoke_subcommand(args, parser, main_command_usage, subcommands): """ Dispatch to subcommand handler borrowed from combo-layer. diff --git a/scripts/wic b/scripts/wic index cf968591e26..dda72a9c277 100755 --- a/scripts/wic +++ b/scripts/wic @@ -277,7 +277,7 @@ subcommands = { hlp.wic_list_help], "plugins": [wic_help_topic_subcommand, wic_help_topic_usage, - hlp.wic_plugins_help], + hlp.get_wic_plugins_help()], "overview": [wic_help_topic_subcommand, wic_help_topic_usage, hlp.wic_overview_help], |