rich_click.rich_group
Classes
| Name | Description |
|---|---|
RichGroup | A click Group that prints its help and errors with Rich. The group decorator creates one. |
RichGroupclass#
class RichGroup(panels: list[RichPanel[Any, Any]] | None = None, aliases: Iterable[str] | None = None, name: str | None = None, commands: MutableMapping[str, click.Command] | Sequence[click.Command] | None = None, invoke_without_command: bool = False, no_args_is_help: bool | None = None, subcommand_metavar: str | None = None, chain: bool = False, result_callback: Callable[..., Any] | None = None, context_settings: MutableMapping[str, Any] | None = None, callback: Callable[..., Any] | None = None, params: list[click.Parameter] | None = None, help: str | None = None, epilog: str | None = None, short_help: str | None = None, options_metavar: str | None = '[OPTIONS]', add_help_option: bool = True, hidden: bool = False, deprecated: bool | str = False)Bases: RichGroupMixin, RichCommand, Group
A click Group that prints its help and errors with Rich. The group decorator creates one.
command_classattributeclass attributeinstance attribute#
command_class: type[RichCommand] | None = RichCommandgroup_classattributeclass attributeinstance attribute#
group_class: type[Group] | type[type] | None = typeadd_commandmethod#
def add_command(cmd: click.Command, name: str | None = None, aliases: Iterable[str] | None = None, panel: str | list[str] | None = None) -> Noneformat_commandsmethod#
def format_commands(ctx: click.Context, formatter: click.HelpFormatter) -> Noneformat_helpmethod#
def format_help(ctx: RichContext, formatter: RichHelpFormatter) -> Noneget_commandmethod#
def get_command(ctx: click.Context, cmd_name: str) -> click.Command | NoneInherited from rich_click.rich_command.RichGroupMixin
add_command_to_panelmethod#
Inherited from
rich_click.rich_command.RichGroupMixinView sourcedef add_command_to_panel(command: click.Command, panel_name: str | Iterable[str]) -> Nonecommandmethod#
Inherited from
rich_click.rich_command.RichGroupMixinView sourcedef command(*args: Any, **kwargs: Any) -> AnyCreate a command and add it to this group.
Takes the same arguments as the command decorator, and works with or without
parentheses. The class of the command is command_class, unless you set cls.
groupmethod#
Inherited from
rich_click.rich_command.RichGroupMixinView sourcedef group(*args: Any, **kwargs: Any) -> AnyCreate a subgroup and add it to this group.
Takes the same arguments as the group decorator, and works with or without
parentheses. The subgroup has the same class as this group, unless you set group_class or cls.
Inherited from rich_click.rich_command.RichCommand
aliasesattributeinstance attribute#
aliases: Iterable[str]context_classattributeclass attributeinstance attribute#
context_class: type[RichContext] = RichContextpanelattributeinstance attribute#
panel: str | Nonepanelsattributeinstance attribute#
panels: list[RichPanel[Any, Any]]consoleproperty#
console: Console | Nonehelp_configproperty#
help_config: RichHelpConfiguration | Noneadd_panelmethod#
def add_panel(panel: RichPanel[Any, Any]) -> Noneformat_epilogmethod#
def format_epilog(ctx: RichContext, formatter: RichHelpFormatter) -> Noneformat_help_textmethod#
def format_help_text(ctx: RichContext, formatter: RichHelpFormatter) -> Noneformat_optionsmethod#
def format_options(ctx: click.Context, formatter: click.HelpFormatter) -> Noneget_help_optionmethod#
def get_help_option(ctx: click.Context) -> click.Option | Noneget_rich_table_rowmethod#
def get_rich_table_row(ctx: RichContext, formatter: RichHelpFormatter, panel: RichCommandPanel | None = None) -> RichPanelRowmainmethod#
def main(args: Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: Any) -> Anyto_info_dictmethod#
def to_info_dict(ctx: click.Context) -> dict[str, Any]