# Path: kamcli/cli.py
# COMMAND_ALIASES = {
#     "subs": "subscriber",
#     "rpc": "jsonrpc",
#     "sht": "htable",
# }
# CONTEXT_SETTINGS = dict(
#     auto_envvar_prefix="KAMCLI", help_option_names=["-h", "--help"]
# )
# def read_global_config(config_paths):
# def parse_user_spec(ctx, ustr):
#     def __init__(self):
#     def log(self, msg, *args):
#     def vlog(self, msg, *args):
#     def printf(self, msg, *args):
#     def printnlf(self, msg, *args):
#     def read_config(self):
#     def gconfig(self):
#     def list_commands(self, ctx):
#     def get_command(self, ctx, name):
# def cli(ctx, debug, config, wdir, nodefaultconfigs, oformat):
# class Context(object):
# class KamCLI(click.MultiCommand):
# 
# Path: kamcli/cli.py
# COMMAND_ALIASES = {
#     "subs": "subscriber",
#     "rpc": "jsonrpc",
#     "sht": "htable",
# }


import os
import sys
import json
import click
import shutil
from kamcli.cli import pass_context
from kamcli.cli import COMMAND_ALIASES
@cli.command(
    "show", short_help="Show expanded content of configuration file sections"
)
@click.argument("sections", nargs=-1, metavar="<sections>")
@pass_context
def config_show(ctx, sections):
    """Show expanded content of configuration file section"""
    if sections:
        ctx.log("\n---")
    for s in sections:
        ctx.log("[%s]", s)
        for k, v in ctx.gconfig.items(s):
            ctx.log("%s= %s", k, v)
        ctx.log("\n---")


@cli.command("paths", short_help="Show the paths of configuration files")
@pass_context
def config_paths(ctx):
    """Show the paths of configuration files for kamcli"""
    print()
    print(ctx.gconfig_paths)
    print()


@cli.command("cmdaliases", short_help="Show the command aliases")
@pass_context
def config_cmdaliases(ctx):
    """Show the command aliases"""
    print()

# Path: kamcli/cli.py
# COMMAND_ALIASES = {
#     "subs": "subscriber",
#     "rpc": "jsonrpc",
#     "sht": "htable",
# }
# CONTEXT_SETTINGS = dict(
#     auto_envvar_prefix="KAMCLI", help_option_names=["-h", "--help"]
# )
# def read_global_config(config_paths):
# def parse_user_spec(ctx, ustr):
#     def __init__(self):
#     def log(self, msg, *args):
#     def vlog(self, msg, *args):
#     def printf(self, msg, *args):
#     def printnlf(self, msg, *args):
#     def read_config(self):
#     def gconfig(self):
#     def list_commands(self, ctx):
#     def get_command(self, ctx, name):
# def cli(ctx, debug, config, wdir, nodefaultconfigs, oformat):
# class Context(object):
# class KamCLI(click.MultiCommand):
# 
# Path: kamcli/cli.py
# COMMAND_ALIASES = {
#     "subs": "subscriber",
#     "rpc": "jsonrpc",
#     "sht": "htable",
# }


# Path: kamcli/commands/cmd_config.py
import os
import sys
import json
import click
import shutil
from kamcli.cli import pass_context
from kamcli.cli import COMMAND_ALIASES

@cli.command(
    "show", short_help="Show expanded content of configuration file sections"
)
@click.argument("sections", nargs=-1, metavar="<sections>")
@pass_context
def config_show(ctx, sections):
    """Show expanded content of configuration file section"""
    if sections:
        ctx.log("\n---")
    for s in sections:
        ctx.log("[%s]", s)
        for k, v in ctx.gconfig.items(s):
            ctx.log("%s= %s", k, v)
        ctx.log("\n---")


@cli.command("paths", short_help="Show the paths of configuration files")
@pass_context
def config_paths(ctx):
    """Show the paths of configuration files for kamcli"""
    print()
    print(ctx.gconfig_paths)
    print()


@cli.command("cmdaliases", short_help="Show the command aliases")
@pass_context
def config_cmdaliases(ctx):
    """Show the command aliases"""
    print()

    print(json.dumps(COMMAND_ALIASES, indent=4, sort_keys=True))