'Return the subcommand in self.subcommands matching the
given name. The name may either be the name of a subcommand or
an alias. If no subcommand matches, returns None.'

def _subcommand_for_name(self, name):

    for subcommand in self.subcommands:
        if ((name == subcommand.name) or (name in subcommand.aliases)):
            return subcommand
    return None
