# Path: aeriscloud/cli/main.py
# def get_cli(command_name):
#     command_dir = os.path.join(module_path(), 'cli', command_name)
#     return AerisCLI(command_dir, help=cmd_help[command_name])


from click.core import Group
from sphinx.ext.autodoc import Documenter
from aeriscloud.cli.main import get_cli
from __future__ import absolute_import




def setup(app):
    app.add_autodocumenter(ClickDocumenter)


class ClickDocumenter(Documenter):
    """
    This is not a generic documenter for click, even though I'd like it to be,
    that is because we use a custom MultiCommand with symbolic links all over
    the place
    """
    objtype = "click"
    titles_allowed = True

    @classmethod
    def can_document_member(cls, member, membername, isattr, parent):
        return False

    def resolve_name(self, modname, parents, path, base):
        return (path or '') + base, []

    def generate(self, more_content=None, real_modname=None,
                 check_module=False, all_members=False):
        self.directive.info('Building doc for command %s' % self.name)

        # retrieve main cli object

# Path: aeriscloud/cli/main.py
# def get_cli(command_name):
#     command_dir = os.path.join(module_path(), 'cli', command_name)
#     return AerisCLI(command_dir, help=cmd_help[command_name])


# Path: aeriscloud/sphinx/click.py
from click.core import Group
from sphinx.ext.autodoc import Documenter
from aeriscloud.cli.main import get_cli

from __future__ import absolute_import




def setup(app):
    app.add_autodocumenter(ClickDocumenter)


class ClickDocumenter(Documenter):
    """
    This is not a generic documenter for click, even though I'd like it to be,
    that is because we use a custom MultiCommand with symbolic links all over
    the place
    """
    objtype = "click"
    titles_allowed = True

    @classmethod
    def can_document_member(cls, member, membername, isattr, parent):
        return False

    def resolve_name(self, modname, parents, path, base):
        return (path or '') + base, []

    def generate(self, more_content=None, real_modname=None,
                 check_module=False, all_members=False):
        self.directive.info('Building doc for command %s' % self.name)

        # retrieve main cli object

        cli = get_cli(self.name)