# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=unused-import
# pylint: disable=super-with-arguments

import azext_devcenter._help
from azure.cli.core import AzCommandsLoader


class DevCenterCommandsLoader(AzCommandsLoader):
    def __init__(self, cli_ctx=None):
        from azure.cli.core.commands import CliCommandType
        from azext_devcenter._client_factory import cf_devcenter_cl

        devcenter_custom = CliCommandType(
            operations_tmpl="azext_devcenter.custom#{}", client_factory=cf_devcenter_cl
        )
        parent = super(DevCenterCommandsLoader, self)
        parent.__init__(cli_ctx=cli_ctx, custom_command_type=devcenter_custom)

    def load_command_table(self, args):
        from azext_devcenter.commands import load_command_table
        from azure.cli.core.aaz import load_aaz_command_table
        try:
            from . import aaz
        except ImportError:
            aaz = None
        if aaz:
            load_aaz_command_table(
                loader=self,
                aaz_pkg_name=aaz.__name__,
                args=args
            )

        load_command_table(self, args)
        return self.command_table

    def load_arguments(self, command):
        from azext_devcenter._params import load_arguments

        load_arguments(self, command)


COMMAND_LOADER_CLS = DevCenterCommandsLoader
