def register(self, name=None):
if name is None:<EOL><INDENT>return register(self)<EOL><DEDENT>else:<EOL><INDENT>return self.register_command(name)<EOL><DEDENT>
Decorator to (create and) register a command from a function.

        Args
        ----
        name : Optional[str]
            If present, create a command and register it (see
            ``register_command``).

        Example
        -------
        .. testcode::

           mygit = Command(name='status')

           @mygit.register(name='status')
           def status():
               print 'Nothing to commit.'

           @mygit.register()
           @command(name='log')
           def log():
               print 'Show logs.'

        .. doctest::
           :hide:

           >>> mygit.init()
           >>> mygit.parse_args(['status'])
           Nothing to commit.

           >>> mygit.parse_args(['log'])
           Show logs.