From ce0616a471edc90c8c3ba1b6b24f362e29c9de2d Mon Sep 17 00:00:00 2001 From: Eric Gustin <34000337+EricGustin@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:33:19 -0700 Subject: [PATCH] Fix issues in arcade show (#117) # PR Description 1. `arcade show` only supported lowercase args for toolkit and tools. This PR allows the user to use capitalization and the tool/toolkit will still be displayed. 2. `arcade show -T` is now for showing a toolkit and `arcade show -t` is now for showing a tool. --- arcade/arcade/cli/main.py | 8 ++++---- arcade/arcade/cli/utils.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arcade/arcade/cli/main.py b/arcade/arcade/cli/main.py index b291f431..60525e37 100644 --- a/arcade/arcade/cli/main.py +++ b/arcade/arcade/cli/main.py @@ -131,10 +131,10 @@ def new( ) def show( toolkit: Optional[str] = typer.Option( - None, "-t", "--toolkit", help="The toolkit to show the tools of" + None, "-T", "--toolkit", help="The toolkit to show the tools of" ), tool: Optional[str] = typer.Option( - None, "-T", "--tool", help="The specific tool to show details for" + None, "-t", "--tool", help="The specific tool to show details for" ), host: Optional[str] = typer.Option( None, @@ -177,8 +177,8 @@ def show( ( t for t in tools - if t.get_fully_qualified_name().name == tool - or str(t.get_fully_qualified_name()) == tool + if t.get_fully_qualified_name().name.lower() == tool.lower() + or str(t.get_fully_qualified_name()).lower() == tool.lower() ), None, ) diff --git a/arcade/arcade/cli/utils.py b/arcade/arcade/cli/utils.py index d2798378..5b316433 100644 --- a/arcade/arcade/cli/utils.py +++ b/arcade/arcade/cli/utils.py @@ -41,6 +41,7 @@ def create_cli_catalog( Load toolkits from the python environment. """ if toolkit: + toolkit = toolkit.lower() try: prefixed_toolkit = "arcade_" + toolkit toolkits = [Toolkit.from_package(prefixed_toolkit)]