# Path: cliff/command.py
# def _get_distributions_by_modules():
# def _get_distribution_for_module(module):
#     def __init__(self, app, app_args, cmd_name=None):
#     def _load_hooks(self):
#     def get_description(self):
#     def get_epilog(self):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def run(self, parsed_args):
#     def _run_before_hooks(self, parsed_args):
#     def _run_after_hooks(self, parsed_args, return_code):
# class Command(object, metaclass=abc.ABCMeta):


import logging
import stevedore
from cliff import command
class CompleteCommand(command.Command):
    """print bash completion command
    """

    log = logging.getLogger(__name__ + '.CompleteCommand')

    def __init__(self, app, app_args, cmd_name=None):
        super(CompleteCommand, self).__init__(app, app_args, cmd_name)
        self._formatters = stevedore.ExtensionManager(
            namespace='cliff.formatter.completion',
        )

    def get_parser(self, prog_name):
        parser = super(CompleteCommand, self).get_parser(prog_name)
        parser.add_argument(
            "--name",
            default=None,
            metavar='<command_name>',
            help="Command name to support with command completion"
        )
        parser.add_argument(
            "--shell",
            default='bash',
            metavar='<shell>',
            choices=sorted(self._formatters.names()),
            help="Shell being used. Use none for data only (default: bash)"
        )
        return parser

    def get_actions(self, command):

# Path: cliff/command.py
# def _get_distributions_by_modules():
# def _get_distribution_for_module(module):
#     def __init__(self, app, app_args, cmd_name=None):
#     def _load_hooks(self):
#     def get_description(self):
#     def get_epilog(self):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def run(self, parsed_args):
#     def _run_before_hooks(self, parsed_args):
#     def _run_after_hooks(self, parsed_args, return_code):
# class Command(object, metaclass=abc.ABCMeta):


# Path: cliff/complete.py
import logging
import stevedore
from cliff import command

class CompleteCommand(command.Command):
    """print bash completion command
    """

    log = logging.getLogger(__name__ + '.CompleteCommand')

    def __init__(self, app, app_args, cmd_name=None):
        super(CompleteCommand, self).__init__(app, app_args, cmd_name)
        self._formatters = stevedore.ExtensionManager(
            namespace='cliff.formatter.completion',
        )

    def get_parser(self, prog_name):
        parser = super(CompleteCommand, self).get_parser(prog_name)
        parser.add_argument(
            "--name",
            default=None,
            metavar='<command_name>',
            help="Command name to support with command completion"
        )
        parser.add_argument(
            "--shell",
            default='bash',
            metavar='<shell>',
            choices=sorted(self._formatters.names()),
            help="Shell being used. Use none for data only (default: bash)"
        )
        return parser

    def get_actions(self, command):

        the_cmd = self.app.command_manager.find_command(command)