import re


def parse_cli_block(block):
    """
    Goes through the contents of a @parser.command block and extracts
    the components, returning them as a dict.

    :param str block:
    :return Dict:
    """
    cli_arg_dict = dict()
    arg_block_re = re.compile(r'argument\((.*?)\),', re.DOTALL)
    epilog_match = re.search(r'deindent\("""(.*?)"""\)', block, re.DOTALL)
    usage_match = re.search(r'usage="(.+?)"', block)

    args = []
    for match in arg_block_re.finditer(block):
        arg_contents = match.groups()
        args.append(arg_contents)

    if epilog_match is not None and len(epilog_match.groups()) > 0:
        cli_arg_dict["epilog"] = epilog_match.group(1)

    cli_arg_dict["args"] = args

    if usage_match is not None and len(usage_match.groups()) > 0:
        cli_arg_dict["usage"] = usage_match.groups(1)

    return cli_arg_dict