A decorator that creates an instance and registers the decorated
        function as main function, see :meth:`main` for more information.

        .. versionadded:: 0.2

def from_main(cls, signature=''):
        """
        A decorator that creates an instance and registers the decorated
        function as main function, see :meth:`main` for more information.

        .. versionadded:: 0.2
        """
        instance = cls()

        def decorate(function):
            instance.main(signature)(function)
            return instance
        return decorate