(function)
return _NewCommand
Add a custom command without having to faff around with an overbearing API.
Add a custom command without having to faff around with an overbearing API.
Add a custom command without having to faff around with an overbearing API .
def new_command(function):
    """Add a custom command without having to faff around with an overbearing API."""

    class _NewCommand(cmd.Command):
        description = function.__doc__
        user_options = []
        def run(self):
            function()
        def initialize_options(self):
            pass
        def finalize_options(self):
            pass

    return _NewCommand
def new_command ( function ) : class _NewCommand ( cmd . Command ) : description = function . __doc__ user_options = [ ] def run ( self ) : function ( ) def initialize_options ( self ) : pass def finalize_options ( self ) : pass return _NewCommand