Skip to content

rich_click.rich_parameter

Classes

NameDescription
RichArgumentA positional argument of a command, formatted by rich-click. The argument decorator creates one.
RichOptionAn option of a command, formatted by rich-click. The option decorator creates one.
RichParameterBase class of RichOption and RichArgument: a click Parameter that rich-click formats in help.

RichArgumentclass#

class RichArgument(RichParameter, click.Argument)

Bases: RichParameter, click.Argument

A positional argument of a command, formatted by rich-click. The argument decorator creates one.

Arguments are required by default. With nargs=-1, an argument takes any number of values.

Inherited from rich_click.rich_parameter.RichParameter

helpattributeinstance attribute#

help = help

help_styleattributeinstance attribute#

help_style = help_style

panelattributeinstance attribute#

panel = panel

get_rich_helpmethod#

def get_rich_help(ctx: RichContext, formatter: RichHelpFormatter) -> Columns

Get the rich help text for this parameter.

get_rich_table_rowmethod#

def get_rich_table_row(ctx: RichContext, formatter: RichHelpFormatter, panel: RichOptionPanel | None = None) -> RichPanelRow

Create a row for the rich table corresponding with this parameter.

to_info_dictmethod#

def to_info_dict() -> dict[str, Any]

Gather information that could be useful for a tool generating user-facing documentation.

Use click.Context.to_info_dict to traverse the entire CLI structure.

RichOptionclass#

class RichOption(RichParameter, click.Option)

Bases: RichParameter, click.Option

An option of a command, formatted by rich-click. The option decorator creates one.

Inherited from rich_click.rich_parameter.RichParameter

helpattributeinstance attribute#

help = help

help_styleattributeinstance attribute#

help_style = help_style

panelattributeinstance attribute#

panel = panel

get_rich_helpmethod#

def get_rich_help(ctx: RichContext, formatter: RichHelpFormatter) -> Columns

Get the rich help text for this parameter.

get_rich_table_rowmethod#

def get_rich_table_row(ctx: RichContext, formatter: RichHelpFormatter, panel: RichOptionPanel | None = None) -> RichPanelRow

Create a row for the rich table corresponding with this parameter.

to_info_dictmethod#

def to_info_dict() -> dict[str, Any]

Gather information that could be useful for a tool generating user-facing documentation.

Use click.Context.to_info_dict to traverse the entire CLI structure.

RichParameterclass#

class RichParameter(*args: Any, panel: str | list[str] | None = None, help: str | None = None, help_style: StyleType | None = None, **kwargs: Any)

Bases: click.Parameter

Base class of RichOption and RichArgument: a click Parameter that rich-click formats in help.

Create RichParameter instance.

helpattributeinstance attribute#

help = help

help_styleattributeinstance attribute#

help_style = help_style

panelattributeinstance attribute#

panel = panel

get_rich_helpmethod#

def get_rich_help(ctx: RichContext, formatter: RichHelpFormatter) -> Columns

Get the rich help text for this parameter.

get_rich_table_rowmethod#

def get_rich_table_row(ctx: RichContext, formatter: RichHelpFormatter, panel: RichOptionPanel | None = None) -> RichPanelRow

Create a row for the rich table corresponding with this parameter.

to_info_dictmethod#

def to_info_dict() -> dict[str, Any]

Gather information that could be useful for a tool generating user-facing documentation.

Use click.Context.to_info_dict to traverse the entire CLI structure.