diff --git a/README.md b/README.md index bc377795..f9c3599e 100644 --- a/README.md +++ b/README.md @@ -63,4 +63,4 @@ create a copy of [`sample.env`](./abcli/sample.env) as `.env` and fill in the se [![pylint](https://github.com/kamangir/awesome-bash-cli/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/awesome-bash-cli/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/awesome-bash-cli/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/awesome-bash-cli/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/awesome-bash-cli/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/awesome-bash-cli/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/abcli.svg)](https://pypi.org/project/abcli/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/abcli)](https://pypistats.org/packages/abcli) -built by 🌀 [`blue_options-4.157.1`](https://github.com/kamangir/awesome-bash-cli), based on 🪄 [`abcli-9.418.1`](https://github.com/kamangir/awesome-bash-cli). +built by 🌀 [`blue_options-4.161.1`](https://github.com/kamangir/awesome-bash-cli), based on 🪄 [`abcli-9.421.1`](https://github.com/kamangir/awesome-bash-cli). diff --git a/abcli/.abcli/tests/help.sh b/abcli/.abcli/tests/help.sh index eea9ebe1..1b033f15 100644 --- a/abcli/.abcli/tests/help.sh +++ b/abcli/.abcli/tests/help.sh @@ -83,6 +83,9 @@ function test_abcli_help() { \ "@sleep" \ \ + "@test" \ + "@test list" \ + \ "@terraform" \ "@terraform cat" \ "@terraform disable" \ diff --git a/abcli/__init__.py b/abcli/__init__.py index a651cc9f..b101df46 100644 --- a/abcli/__init__.py +++ b/abcli/__init__.py @@ -6,7 +6,7 @@ DESCRIPTION = f"{ICON} a language to speak AI." -VERSION = "9.418.1" +VERSION = "9.421.1" REPO_NAME = "awesome-bash-cli" diff --git a/abcli/help/functions.py b/abcli/help/functions.py index 0d98b7e1..3ed85067 100644 --- a/abcli/help/functions.py +++ b/abcli/help/functions.py @@ -18,8 +18,6 @@ from abcli.help.notebooks import help_functions as help_notebooks from abcli.help.plugins import help_functions as help_plugins from abcli.help.open import help_open -from abcli.help.pypi import help_functions as help_pypi -from abcli.help.pytest import help_pytest from abcli.help.repeat import help_repeat from abcli.help.sagemaker import help_functions as help_sagemaker from abcli.help.seed import help_functions as help_seed diff --git a/abcli/help/generic.py b/abcli/help/generic.py index 2e0ae516..70684919 100644 --- a/abcli/help/generic.py +++ b/abcli/help/generic.py @@ -1,7 +1,8 @@ from typing import List, Dict, Callable, Union -from abcli.help.pytest import help_pytest from abcli.help.pypi import help_functions as help_pypi +from abcli.help.pytest import help_pytest +from abcli.help.test import help_functions as help_test def help_functions( @@ -14,4 +15,5 @@ def help_functions( mono=mono, plugin_name=plugin_name, ), + "test": help_test(plugin_name=plugin_name), } diff --git a/abcli/help/test.py b/abcli/help/test.py new file mode 100644 index 00000000..28ddcda4 --- /dev/null +++ b/abcli/help/test.py @@ -0,0 +1,75 @@ +from typing import List, Dict, Callable, Union + +from blue_options.terminal import show_usage, xtra + + +def help_( + tokens: List[str], + mono: bool, + plugin_name: str = "abcli", +) -> str: + options = xtra( + "what=all|,dryrun", + mono=mono, + ) + + test_options = xtra( + "dryrun", + mono=mono, + ) + + callable = f"{plugin_name} test" + + if plugin_name == "abcli": + options = f"{options},plugin=" + callable = "@test" + + return show_usage( + callable.split(" ") + + [ + f"[{options}]", + f"[{test_options}]", + ], + f"test {plugin_name}.", + mono=mono, + ) + + +def help_list( + tokens: List[str], + mono: bool, + plugin_name: str = "abcli", +) -> str: + options = "list" + + callable = f"{plugin_name} test" + + if plugin_name == "abcli": + options = f"{options},plugin=" + callable = "@test" + + return show_usage( + callable.split(" ") + + [ + f"{options}", + ], + f"list {plugin_name} tests.", + mono=mono, + ) + + +def help_functions( + plugin_name: str = "abcli", +) -> Union[Callable, Dict[str, Union[Callable, Dict]]]: + return { + "": lambda tokens, mono: help_( + tokens, + mono=mono, + plugin_name=plugin_name, + ), + "list": lambda tokens, mono: help_list( + tokens, + mono=mono, + plugin_name=plugin_name, + ), + }