Resolves Issue #215

This commit is contained in:
BJ Dierkes 2013-11-13 13:05:35 -06:00
parent d478b61010
commit 1ea22ba1c8
3 changed files with 12 additions and 1 deletions

View File

@ -21,7 +21,7 @@ is available online at:
Bugs:
* None
* :issue:`215` - Epilog not printed on --help
Features:

View File

@ -437,6 +437,10 @@ class CementBaseController(handler.CementBaseHandler):
command to dispatch, and if so... dispatches it.
"""
if hasattr(self._meta, 'epilog') \
and self._meta.epilog is not None:
self.app.args.epilog = self._meta.epilog
self._arguments, self._commands = self._collect()
self._process_commands()
self._get_dispatch_command()

View File

@ -10,6 +10,7 @@ class TestController(controller.CementBaseController):
(['-f', '--foo'], dict(help='foo option'))
]
usage = 'My Custom Usage TXT'
epilog = "This is the epilog"
@controller.expose(hide=True)
def default(self):
@ -109,6 +110,12 @@ class ControllerTestCase(test.CementCoreTestCase):
app.setup()
app.run()
def test_epilog(self):
app = self.make_app(base_controller=TestController)
app.setup()
app.run()
self.eq(app.args.epilog, 'This is the epilog')
def test_txt_defined_base_controller(self):
handler.register(TestController)
self.app.setup()