Skip to content

Commit

Permalink
feat: add did you mena in all the commands
Browse files Browse the repository at this point in the history
  • Loading branch information
utkarsh-dixit committed Jun 4, 2024
1 parent 690b4ca commit 9f64efb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion composio/cli/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

from composio.cli.context import Context, pass_context
from composio.client.enums import App
from composio.core.cls.did_you_mean import DYMGroup
from composio.exceptions import ComposioSDKError


@click.group(name="actions", invoke_without_command=True)
@click.group(name="actions", invoke_without_command=True, cls=DYMGroup)
@click.option(
"--app",
"apps",
Expand Down
3 changes: 2 additions & 1 deletion composio/cli/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
import click

from composio.cli.context import Context, pass_context
from composio.core.cls.did_you_mean import DYMGroup
from composio.exceptions import ComposioSDKError


@click.group(name="connections", invoke_without_command=True)
@click.group(name="connections", invoke_without_command=True, cls=DYMGroup)
@pass_context
def _connections(context: Context) -> None:
"""List composio connections for your account"""
Expand Down
3 changes: 2 additions & 1 deletion composio/cli/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
import click

from composio.cli.context import Context, login_required, pass_context
from composio.core.cls.did_you_mean import DYMGroup
from composio.exceptions import ComposioSDKError


@click.group(name="integrations", invoke_without_command=True)
@click.group(name="integrations", invoke_without_command=True, cls=DYMGroup)
@login_required
@pass_context
def _integrations(context: Context) -> None:
Expand Down
3 changes: 2 additions & 1 deletion composio/cli/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

from composio.cli.context import Context, pass_context
from composio.client.exceptions import NoItemsFound
from composio.core.cls.did_you_mean import DYMGroup
from composio.exceptions import ComposioSDKError


@click.group(name="triggers", invoke_without_command=True)
@click.group(name="triggers", invoke_without_command=True, cls=DYMGroup)
@click.option(
"--active",
is_flag=True,
Expand Down
3 changes: 1 addition & 2 deletions composio/core/cls/did_you_mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def resolve_command(
)
if matches:
fmt_matches = "\n ".join(matches)
error_msg += "\n\n"
error_msg += f"Did you mean one of these?\n {fmt_matches}"
error_msg += f" Did you mean one of these?\n {fmt_matches}"

raise click.exceptions.UsageError(error_msg, error.ctx) from error

Expand Down

0 comments on commit 9f64efb

Please sign in to comment.