diff --git a/CHANGES.txt b/CHANGES.txt index 6c976e39..766ef45d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,7 +4,11 @@ Changelog 4.2.19 (unreleased) ------------------- -- Nothing changed yet. +- Handle commands registered for zopectl as well, + up to now they were handled but not displayed at all + (ie in help and descriptions). + https://github.com/plone/plone.recipe.zope2instance/issues/18 + [gforcada] 4.2.18 (2015-07-27) diff --git a/src/plone/recipe/zope2instance/ctl.py b/src/plone/recipe/zope2instance/ctl.py index 8b9e0e06..7866ad20 100644 --- a/src/plone/recipe/zope2instance/ctl.py +++ b/src/plone/recipe/zope2instance/ctl.py @@ -596,6 +596,15 @@ def main(args=None): if func_name not in dir(c): setattr(c.__class__, func_name, func) + # Mix in any additional commands supplied by other packages + # registered for zopectl: + for ep in iter_entry_points('zopectl.command'): + func_name = 'do_' + ep.name + func = ep.load() + # avoid overwriting the standard commands + if func_name not in dir(c): + setattr(c.__class__, func_name, func) + # If a command was specified: call the corresponding do_*() method. # # If that method set an exit status, exit this Python script