def add_postprocessor(postproc):
    """
    Define a postprocessor to run after the function is executed, when
    running in console script mode.

    :param postproc: The callable, which will be passed the Namespace
                     object generated by argparse and the return
                     result of the function.  The return result of the
                     callable will be used as the final return result
                     (or as the result fed into the next
                     postprocessor).
    """

    def decorator(func):
        func = ScriptAdaptor._wrap(func)
        func._add_postprocessor(postproc)
        return func
    return decorator
Define a postprocessor to run after the function is executed, when
    running in console script mode.

    :param postproc: The callable, which will be passed the Namespace
                     object generated by argparse and the return
                     result of the function.  The return result of the
                     callable will be used as the final return result
                     (or as the result fed into the next
                     postprocessor).