from textwrap import dedent


def epilog(docstring):
    """Fixes the docstring so it displays properly

    I have problems with docstrings and indentation showing up right
    in click. This fixes that. Plus it allows me to add dynamically
    generated bits to the docstring.

    """
    def _epilog(fun):
        fun.__doc__ = dedent(fun.__doc__) + docstring
        return fun
    return _epilog