Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix Rich rendering #58

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions lamin_cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import inspect
from importlib.metadata import PackageNotFoundError, version
from typing import Optional, Mapping
from functools import wraps

# https://github.com/ewels/rich-click/issues/19
# Otherwise rich-click takes over the formatting.
Expand Down Expand Up @@ -60,12 +61,18 @@ def list_commands(self, ctx: click.Context) -> Mapping[str, click.Command]:
]
}

lamin_group_decorator = click.rich_config(
help_config=click.RichHelpConfiguration(
command_groups=COMMAND_GROUPS,
style_commands_table_column_width_ratio=(1, 13),
def lamin_group_decorator(f):
@click.rich_config(
help_config=click.RichHelpConfiguration(
command_groups=COMMAND_GROUPS,
style_commands_table_column_width_ratio=(1, 13),
)
)
)(click.group())
@click.group()
@wraps(f)
def wrapper(*args, **kwargs):
return f(*args, **kwargs)
return wrapper


from click import Command, Context
Expand Down