# 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/iorpc.py
# def command_ctl(ctx, cmd, params=[], cbexec={}):
#     """Execute a rpc control command
# 
#     \b
#     Parameters:
#       - ctx: kamcli execution context
#       - cmd: the string with rpc control command
#       - params: an array with the parameters for the rpc control command
#       - cbexec: dictionary with callaback function and its parameters
#                 to handle the response of the rpc control commands. If not
#                 provided, the response will be printed with the function
#                 command_ctl_response_print().
#                 The callback function has to be provided by 'func' key in
#                 the dictionary and its parameters by 'params' key.
#     """
# 
#     if ctx.gconfig.get("jsonrpc", "transport") == "socket":
#         command_jsonrpc_socket(
#             ctx,
#             False,
#             ctx.gconfig.get("jsonrpc", "srvaddr"),
#             ctx.gconfig.get("jsonrpc", "rcvaddr"),
#             ctx.gconfig.get("jsonrpc", "outformat"),
#             command_ctl_name(cmd, "rpc"),
#             params,
#             cbexec,
#         )
#     else:
#         command_jsonrpc_fifo(
#             ctx,
#             False,
#             ctx.gconfig.get("jsonrpc", "path"),
#             ctx.gconfig.get("jsonrpc", "rplnamebase"),
#             ctx.gconfig.get("jsonrpc", "outformat"),
#             command_ctl_name(cmd, "rpc"),
#             params,
#             cbexec,
#         )


import click
from kamcli.cli import pass_context
from kamcli.iorpc import command_ctl


@click.group(
    "pkg",
    help="Private memory (pkg) management",
    short_help="Private memory (pkg) management",
)

# 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/iorpc.py
# def command_ctl(ctx, cmd, params=[], cbexec={}):
#     """Execute a rpc control command
# 
#     \b
#     Parameters:
#       - ctx: kamcli execution context
#       - cmd: the string with rpc control command
#       - params: an array with the parameters for the rpc control command
#       - cbexec: dictionary with callaback function and its parameters
#                 to handle the response of the rpc control commands. If not
#                 provided, the response will be printed with the function
#                 command_ctl_response_print().
#                 The callback function has to be provided by 'func' key in
#                 the dictionary and its parameters by 'params' key.
#     """
# 
#     if ctx.gconfig.get("jsonrpc", "transport") == "socket":
#         command_jsonrpc_socket(
#             ctx,
#             False,
#             ctx.gconfig.get("jsonrpc", "srvaddr"),
#             ctx.gconfig.get("jsonrpc", "rcvaddr"),
#             ctx.gconfig.get("jsonrpc", "outformat"),
#             command_ctl_name(cmd, "rpc"),
#             params,
#             cbexec,
#         )
#     else:
#         command_jsonrpc_fifo(
#             ctx,
#             False,
#             ctx.gconfig.get("jsonrpc", "path"),
#             ctx.gconfig.get("jsonrpc", "rplnamebase"),
#             ctx.gconfig.get("jsonrpc", "outformat"),
#             command_ctl_name(cmd, "rpc"),
#             params,
#             cbexec,
#         )


# Path: kamcli/commands/cmd_pkg.py
import click
from kamcli.cli import pass_context
from kamcli.iorpc import command_ctl



@click.group(
    "pkg",
    help="Private memory (pkg) management",
    short_help="Private memory (pkg) management",
)

@pass_context