From d9d611505403037945e119f2873ded344b563337 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Mon, 24 Aug 2026 13:28:56 -0600 Subject: [PATCH] style(cli): align help output at column 5 and title the dl panel Services --- unshackle/core/services.py | 9 ++++++++- unshackle/core/themes.py | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/unshackle/core/services.py b/unshackle/core/services.py index 284103c0..f2c9d1a7 100644 --- a/unshackle/core/services.py +++ b/unshackle/core/services.py @@ -127,8 +127,15 @@ class Services(click.Group): remote_services_cache: list[dict] | None = None + def format_help(self, ctx: click.Context, formatter: click.HelpFormatter) -> None: + """Name the commands panel ``Services``, because this group's commands are services.""" + config = getattr(formatter, "config", None) + if config is not None: + config.commands_panel_title = "Services" + super().format_help(ctx, formatter) + def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]: - """Preprocess --slow so it can take an optional range value before Click parses args.""" + """Preprocess ``--slow`` so it can take an optional range value before Click parses the arguments.""" processed = [] i = 0 while i < len(args): diff --git a/unshackle/core/themes.py b/unshackle/core/themes.py index d8c38280..a7b722bb 100644 --- a/unshackle/core/themes.py +++ b/unshackle/core/themes.py @@ -193,7 +193,7 @@ def resolve_palette(name: object) -> dict[str, str] | None: def build_help_config(palette: dict[str, str]) -> RichHelpConfiguration: - """Assemble the rich-click help styling for a palette.""" + """Assemble the rich-click help configuration for a palette.""" return RichHelpConfiguration( style_option=palette["text"], style_switch=palette["green"], @@ -224,6 +224,13 @@ def build_help_config(palette: dict[str, str]) -> RichHelpConfiguration: style_options_table_box="HORIZONTALS", style_options_table_show_lines=True, style_options_table_border_style=palette["dark_gray"], + padding_helptext=(0, 1, 1, 5), + padding_usage=(1, 1, 1, 5), + style_options_panel_padding=(0, 1, 0, 3), + style_commands_panel_padding=(0, 1, 0, 4), + panel_title_padding=3, + padding_errors_panel=(0, 1, 1, 5), + padding_errors_suggestion=(0, 1, 0, 5), )