def METHOD_NAME(ctx, command, stack) -> CommandInfo:
    name = " ".join(stack)
    formatter = ctx.make_formatter()
    command.format_usage(ctx, formatter)
    usage = click.unstyle(formatter.getvalue())
    usage = re.split(r"usage\s*:", usage, maxsplit=2, flags=re.IGNORECASE)[1].strip()
    short = click.unstyle(command.get_short_help_str(80))
    is_group = isinstance(command, click.MultiCommand)
    info = CommandInfo(name=name, usage=usage, short=short, is_group=is_group)
    formatter = ctx.make_formatter()
    command.format_help_text(ctx, formatter)
    help = click.unstyle(formatter.getvalue())
    parts = re.split(r"examples:", help, flags=re.IGNORECASE)
    info.description = dedent(parts[0])
    if len(parts) > 1:
        assert len(parts) == 2
        info.examples = dedent(parts[1])
    for param in command.get_params(ctx):
        ret = param.get_help_record(ctx)
        if ret:
            info.options.append(Option(click.unstyle(ret[0]), click.unstyle(ret[1])))
    return info