rich_click.rich_parameter
Classes
| Name | Description |
|---|---|
RichArgument | A positional argument of a command, formatted by rich-click. The argument decorator creates one. |
RichOption | An option of a command, formatted by rich-click. The option decorator creates one. |
RichParameter | Base 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 = helphelp_styleattributeinstance attribute#
help_style = help_stylepanelattributeinstance attribute#
panel = panelget_rich_helpmethod#
def get_rich_help(ctx: RichContext, formatter: RichHelpFormatter) -> ColumnsGet the rich help text for this parameter.
get_rich_table_rowmethod#
def get_rich_table_row(ctx: RichContext, formatter: RichHelpFormatter, panel: RichOptionPanel | None = None) -> RichPanelRowCreate 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 = helphelp_styleattributeinstance attribute#
help_style = help_stylepanelattributeinstance attribute#
panel = panelget_rich_helpmethod#
def get_rich_help(ctx: RichContext, formatter: RichHelpFormatter) -> ColumnsGet the rich help text for this parameter.
get_rich_table_rowmethod#
def get_rich_table_row(ctx: RichContext, formatter: RichHelpFormatter, panel: RichOptionPanel | None = None) -> RichPanelRowCreate 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 = helphelp_styleattributeinstance attribute#
help_style = help_stylepanelattributeinstance attribute#
panel = panelget_rich_helpmethod#
def get_rich_help(ctx: RichContext, formatter: RichHelpFormatter) -> ColumnsGet the rich help text for this parameter.
get_rich_table_rowmethod#
def get_rich_table_row(ctx: RichContext, formatter: RichHelpFormatter, panel: RichOptionPanel | None = None) -> RichPanelRowCreate 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.