# Path: ecmcli/commands/base.py
# def toxml(data, root_tag='ecmcli'):
#     def crawl(obj, parent):
# def totuples(data):
#     def crawl(obj, path):
# def todict(obj, str_array_keys=False):
#     def api_complete(self, resource, field, startswith):
#     def make_completer(self, resource, field):
#         def cached(startswith):
#         def wrap(startswith, *args):
#     def api_search(self, resource, fields, terms, match='icontains',
#                    **options):
#     def res_flatten(self, resource, fields):
#     def confirm(self, msg, exit=True):
#     def make_searcher(self, resource, field_desc, **search_options):
#         def lookup(terms, **options):
#         def complete(startswith, args):
#     def add_completer_argument(self, *keys, resource=None, res_field=None,
#                                **options):
#     def add_router_argument(self, *keys, **options):
#     def add_group_argument(self, *keys, **options):
#     def add_account_argument(self, *keys, **options):
#     def add_product_argument(self, *keys, **options):
#     def add_firmware_argument(self, *keys, **options):
#     def add_role_argument(self, *keys, **options):
#     def add_user_argument(self, *keys, **options):
#     def add_search_argument(self, searcher, *keys, **options):
#     def inject_table_factory(self, *args, **kwargs):
#         def setup_make_table(argument_ns):
# class ECMCommand(shellish.Command):
# 
# Path: ecmcli/commands/shtools.py
# class Debug(base.ECMCommand):
#     def run(self, args):


import importlib
import logging
import pkg_resources
import shellish
import shellish.logging
import sys
from . import api
from .commands import base, shtools
from shellish.command import contrib
class ECMRoot(base.ECMCommand):
    """ ECM Command Line Interface

    This utility represents a collection of sub-commands to perform against
    the Cradlepoint ECM service.  You must already have a valid ECM
    username/password to use this tool.  For more info go to
    https://cradlepointecm.com/. """

    name = 'ecm'
    use_pager = False
    Session = ECMSession

    def setup_args(self, parser):
        distro = pkg_resources.get_distribution('ecmcli')
        self.add_argument('--api-username')
        self.add_argument('--api-password')
        self.add_argument('--api-site',
                          help='E.g. https://cradlepointecm.com')
        self.add_argument('--debug', action='store_true')
        self.add_argument('--trace', action='store_true')
        self.add_argument('--no-pager', action='store_true')
        self.add_argument('--version', action='version',
                          version=distro.version)
        self.add_subcommand(contrib.Commands)
        self.add_subcommand(contrib.SystemCompletion)
        self.add_subcommand(contrib.Help)

    def prerun(self, args):
        """ Add the interactive commands just before it goes to the prompt so
        they don't show up in the --help from the commands line. """

# Path: ecmcli/commands/base.py
# def toxml(data, root_tag='ecmcli'):
#     def crawl(obj, parent):
# def totuples(data):
#     def crawl(obj, path):
# def todict(obj, str_array_keys=False):
#     def api_complete(self, resource, field, startswith):
#     def make_completer(self, resource, field):
#         def cached(startswith):
#         def wrap(startswith, *args):
#     def api_search(self, resource, fields, terms, match='icontains',
#                    **options):
#     def res_flatten(self, resource, fields):
#     def confirm(self, msg, exit=True):
#     def make_searcher(self, resource, field_desc, **search_options):
#         def lookup(terms, **options):
#         def complete(startswith, args):
#     def add_completer_argument(self, *keys, resource=None, res_field=None,
#                                **options):
#     def add_router_argument(self, *keys, **options):
#     def add_group_argument(self, *keys, **options):
#     def add_account_argument(self, *keys, **options):
#     def add_product_argument(self, *keys, **options):
#     def add_firmware_argument(self, *keys, **options):
#     def add_role_argument(self, *keys, **options):
#     def add_user_argument(self, *keys, **options):
#     def add_search_argument(self, searcher, *keys, **options):
#     def inject_table_factory(self, *args, **kwargs):
#         def setup_make_table(argument_ns):
# class ECMCommand(shellish.Command):
# 
# Path: ecmcli/commands/shtools.py
# class Debug(base.ECMCommand):
#     def run(self, args):


# Path: ecmcli/main.py
import importlib
import logging
import pkg_resources
import shellish
import shellish.logging
import sys
from . import api
from .commands import base, shtools
from shellish.command import contrib

class ECMRoot(base.ECMCommand):
    """ ECM Command Line Interface

    This utility represents a collection of sub-commands to perform against
    the Cradlepoint ECM service.  You must already have a valid ECM
    username/password to use this tool.  For more info go to
    https://cradlepointecm.com/. """

    name = 'ecm'
    use_pager = False
    Session = ECMSession

    def setup_args(self, parser):
        distro = pkg_resources.get_distribution('ecmcli')
        self.add_argument('--api-username')
        self.add_argument('--api-password')
        self.add_argument('--api-site',
                          help='E.g. https://cradlepointecm.com')
        self.add_argument('--debug', action='store_true')
        self.add_argument('--trace', action='store_true')
        self.add_argument('--no-pager', action='store_true')
        self.add_argument('--version', action='version',
                          version=distro.version)
        self.add_subcommand(contrib.Commands)
        self.add_subcommand(contrib.SystemCompletion)
        self.add_subcommand(contrib.Help)

    def prerun(self, args):
        """ Add the interactive commands just before it goes to the prompt so
        they don't show up in the --help from the commands line. """

        for x in shtools.command_classes: