# Path: biggraphite/settings.py
# DEFAULT_LOG_LEVEL = "WARNING"
# DEFAULT_ADMIN_PORT = None
# OPTIONS = {
#     "driver": str,
#     "metadata_driver": strvalidator,
#     "data_driver": strvalidator,
#     "cache": str,
#     "cache_size": strtoint,
#     "cache_ttl": strtoint,
#     "cache_sync": strtobool,
#     "loglevel": str,
#     "storage_dir": str,
#     "admin_port": strtoint,
#     "creation_rate_limit": strtoint,
# }
# def strtoint(value):
# def strtobool(value):
# def strvalidator(value):
# def add_argparse_arguments(parser):
# def get_setting(settings, name):
# def settings_from_args(args):
# def settings_from_confattr(conf, prefix="bg_"):


import argparse
import logging
import flask_restplus as rp
from biggraphite.cli.web import context
from biggraphite.cli.web.capture import Capture
from biggraphite import settings as bg_settings
    from biggraphite.cli import commands

class UnknownCommandException(Exception):
    """Unknown command exception."""

    def __init__(self, command_name):
        """Init UnknownCommandException."""
        super(UnknownCommandException, self).__init__(
            "Unknown command: %s" % command_name
        )


def parse_command(command_name, payload):
    """Parse and build a BgUtil command."""
    # Import that here only because we are inside a command and `commands`
    # need to be able to import files from all commands.

    cmd = None
    for cmd in commands.COMMANDS:
        if cmd.NAME == command_name:
            break
    if not cmd or cmd.NAME != command_name:
        raise UnknownCommandException(command_name)

    parser = NonExitingArgumentParser(add_help=False)
    parser.add_argument(
        "--help",
        action=_HelpAction,
        default=argparse.SUPPRESS,
        help="Show this help message and exit.",
    )

# Path: biggraphite/settings.py
# DEFAULT_LOG_LEVEL = "WARNING"
# DEFAULT_ADMIN_PORT = None
# OPTIONS = {
#     "driver": str,
#     "metadata_driver": strvalidator,
#     "data_driver": strvalidator,
#     "cache": str,
#     "cache_size": strtoint,
#     "cache_ttl": strtoint,
#     "cache_sync": strtobool,
#     "loglevel": str,
#     "storage_dir": str,
#     "admin_port": strtoint,
#     "creation_rate_limit": strtoint,
# }
# def strtoint(value):
# def strtobool(value):
# def strvalidator(value):
# def add_argparse_arguments(parser):
# def get_setting(settings, name):
# def settings_from_args(args):
# def settings_from_confattr(conf, prefix="bg_"):


# Path: biggraphite/cli/web/namespaces/bgutil.py
import argparse
import logging
import flask_restplus as rp
from biggraphite.cli.web import context
from biggraphite.cli.web.capture import Capture
from biggraphite import settings as bg_settings
    from biggraphite.cli import commands


class UnknownCommandException(Exception):
    """Unknown command exception."""

    def __init__(self, command_name):
        """Init UnknownCommandException."""
        super(UnknownCommandException, self).__init__(
            "Unknown command: %s" % command_name
        )


def parse_command(command_name, payload):
    """Parse and build a BgUtil command."""
    # Import that here only because we are inside a command and `commands`
    # need to be able to import files from all commands.

    cmd = None
    for cmd in commands.COMMANDS:
        if cmd.NAME == command_name:
            break
    if not cmd or cmd.NAME != command_name:
        raise UnknownCommandException(command_name)

    parser = NonExitingArgumentParser(add_help=False)
    parser.add_argument(
        "--help",
        action=_HelpAction,
        default=argparse.SUPPRESS,
        help="Show this help message and exit.",
    )

    bg_settings.add_argparse_arguments(parser)