diff --git a/SoftLayer/CLI/core.py b/SoftLayer/CLI/core.py index 870c47f0f..99596d81a 100644 --- a/SoftLayer/CLI/core.py +++ b/SoftLayer/CLI/core.py @@ -179,7 +179,7 @@ def main(reraise_exceptions=False, **kwargs): exit_status = 0 try: - cli.main(**kwargs) + cli.main(**kwargs, standalone_mode=False) except SoftLayer.SoftLayerAPIError as ex: if 'invalid api token' in ex.faultString.lower(): print("Authentication Failed: To update your credentials, use 'slcli config setup'") @@ -193,6 +193,9 @@ def main(reraise_exceptions=False, **kwargs): except exceptions.CLIAbort as ex: print(str(ex.message)) exit_status = ex.code + except click.UsageError as ex: + print(str(ex.message)) + exit_status = ex.exit_code except Exception: if reraise_exceptions: raise diff --git a/SoftLayer/CLI/hardware/list.py b/SoftLayer/CLI/hardware/list.py index 65a95718e..c09e587ea 100644 --- a/SoftLayer/CLI/hardware/list.py +++ b/SoftLayer/CLI/hardware/list.py @@ -53,6 +53,8 @@ @click.option('--owner', help='Filter by created_by username') @click.option('--primary_ip', help='Filter by Primary Ip Address') @click.option('--backend_ip', help='Filter by Backend Ip Address') +# https://click.palletsprojects.com/en/stable/options/#optional-value +# Search doesn't require options. @click.option('--search', is_flag=False, flag_value="", default=None, help="Use the more flexible Search API to list instances. See `slcli search --types` for list " + "of searchable fields.") diff --git a/setup.py b/setup.py index ec0f02c66..2c2700125 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ 'prompt_toolkit >= 2', 'pygments >= 2.0.0', 'urllib3 >= 1.24', - 'rich == 14.1.0' + 'rich >= 14.1.0' ], keywords=['softlayer', 'cloud', 'slcli', 'ibmcloud'], classifiers=[ diff --git a/tools/requirements.txt b/tools/requirements.txt index 9c988cdca..3ae77fe32 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -4,6 +4,6 @@ requests >= 2.32.2 prompt_toolkit >= 2 pygments >= 2.0.0 urllib3 >= 1.24 -rich == 14.1.0 +rich >= 14.1.0 # only used for soap transport # softlayer-zeep >= 5.0.0 diff --git a/tools/test-requirements.txt b/tools/test-requirements.txt index 4cae08234..0079a2958 100644 --- a/tools/test-requirements.txt +++ b/tools/test-requirements.txt @@ -9,5 +9,5 @@ requests >= 2.32.2 prompt_toolkit >= 2 pygments >= 2.0.0 urllib3 >= 1.24 -rich >= 12.3.0 +rich >= 14.1.0 # softlayer-zeep >= 5.0.0