Skip to content

Commit

Permalink
refactor: make sure that all commands are ordered by listing
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Jul 11, 2024
1 parent 9aa18f7 commit c83a095
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions silverback/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@
from silverback.runner import PollingRunner, WebsocketRunner


@click.group()
class OrderedCommands(click.Group):
# NOTE: Override so we get the list ordered by definition order
def list_commands(self, ctx: click.Context) -> list[str]:
return list(self.commands)


@click.group(cls=OrderedCommands)
def cli():
"""Work with Silverback applications in local context (using Ape)."""

Expand Down Expand Up @@ -218,13 +224,7 @@ def get_client_from_profile(ctx, param, value) -> Client:
)


class PlatformCommands(click.Group):
# NOTE: Override so we get the list ordered by definition order
def list_commands(self, ctx: click.Context) -> list[str]:
return list(self.commands)


@cli.group(cls=PlatformCommands)
@cli.group(cls=OrderedCommands)
def cluster():
"""Connect to hosted application clusters"""

Expand Down

0 comments on commit c83a095

Please sign in to comment.