import click

from sayer.core.commands.base import BaseSayerCommand
from sayer.core.console.sayer import render_help_for_command


class SayerCommand(BaseSayerCommand):
    """
    A custom click.Command that renders help via Sayer's rich help renderer.
    """

    def get_help(self, ctx: click.Context) -> str:
        render_help_for_command(ctx)
        # click.Command.get_help is expected to return a string, though our
        # render_help_for_command likely prints directly. If render_help_for_command
        # does not return a string, we might need to adjust its signature or
        # how it's called to satisfy the expected return type of get_help.
        # For now, let's assume it handles the output and we return an empty string
        # if no explicit string is generated by render_help_for_command.
        return ""
