From da38f6d6eec7a07ec3aa9305a8e3d4398ca7f79c Mon Sep 17 00:00:00 2001 From: Roland Thomas Date: Sat, 26 Jul 2025 18:07:31 -0400 Subject: [PATCH] style(help): improve help display layout and styling for consistency - Wrapped help signatures in `Padding` for better visual spacing. - Updated descriptions and tags to use dimmed text with indentation for clarity. - Added a bold "help:" header to `_show_help()` for clearer section labeling. - Bumped version to 0.1.75. --- falyx/command.py | 24 +++++++++++++++--------- falyx/falyx.py | 1 + falyx/version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/falyx/command.py b/falyx/command.py index 8bca54d..dede937 100644 --- a/falyx/command.py +++ b/falyx/command.py @@ -351,7 +351,7 @@ class Command(BaseModel): return f" {command_keys_text:<20} {options_text} " @property - def help_signature(self) -> tuple[Panel, str]: + def help_signature(self) -> tuple[Padding, str]: """Generate a help signature for the command.""" is_cli_mode = self.options_manager.get("mode") in { FalyxMode.RUN, @@ -362,13 +362,16 @@ class Command(BaseModel): program = f"{self.program} run " if is_cli_mode else "" if self.arg_parser and not self.simple_help_signature: - usage = Panel( - f"[{self.style}]{program}[/]{self.arg_parser.get_usage()}", - expand=False, + usage = Padding( + Panel( + f"[{self.style}]{program}[/]{self.arg_parser.get_usage()}", + expand=False, + ), + (0, 2), ) - description = [f" {self.help_text or self.description}"] + description = [f" [dim]{self.help_text or self.description}[/dim]"] if self.tags: - description.append(f" [dim]Tags: {', '.join(self.tags)}[/dim]") + description.append(f" [dim]Tags: {', '.join(self.tags)}[/dim]") return usage, "\n".join(description) command_keys = " | ".join( @@ -376,9 +379,12 @@ class Command(BaseModel): + [f"[{self.style}]{alias}[/{self.style}]" for alias in self.aliases] ) return ( - Panel( - f"[{self.style}]{program}[/]{command_keys} {self.description}", - expand=False, + Padding( + Panel( + f"[{self.style}]{program}[/]{command_keys} {self.description}", + expand=False, + ), + (0, 2), ), "", ) diff --git a/falyx/falyx.py b/falyx/falyx.py index 6b25bbc..0c574d2 100644 --- a/falyx/falyx.py +++ b/falyx/falyx.py @@ -366,6 +366,7 @@ class Falyx: return choice(tips) async def _show_help(self, tag: str = "") -> None: + self.console.print("[bold]help:[/bold]") if tag: tag_lower = tag.lower() commands = [ diff --git a/falyx/version.py b/falyx/version.py index a52a5aa..0077fa1 100644 --- a/falyx/version.py +++ b/falyx/version.py @@ -1 +1 @@ -__version__ = "0.1.74" +__version__ = "0.1.75" diff --git a/pyproject.toml b/pyproject.toml index 15aea8d..250d305 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "falyx" -version = "0.1.74" +version = "0.1.75" description = "Reliable and introspectable async CLI action framework." authors = ["Roland Thomas Jr "] license = "MIT"