mirror of
https://github.com/datafolklabs/cement.git
synced 2026-02-06 14:16:46 +00:00
Resolves Issue #215
This commit is contained in:
parent
d478b61010
commit
1ea22ba1c8
@ -21,7 +21,7 @@ is available online at:
|
||||
|
||||
Bugs:
|
||||
|
||||
* None
|
||||
* :issue:`215` - Epilog not printed on --help
|
||||
|
||||
Features:
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user