From b08856cd052fbe25a6677fb2942e8b379f260a01 Mon Sep 17 00:00:00 2001 From: kamangir Date: Sun, 5 Jan 2025 12:31:45 -0800 Subject: [PATCH] @help refactor - kamangir/bolt#746 --- README.md | 2 +- abcli/.abcli/plugins/actions.sh | 8 -------- abcli/__init__.py | 2 +- abcli/help/actions.py | 21 +++++++++++++++++++++ abcli/help/functions.py | 2 ++ 5 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 abcli/help/actions.py diff --git a/README.md b/README.md index 53208955..8cc290a5 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.174.1`](https://github.com/kamangir/awesome-bash-cli), based on 🪄 [`abcli-9.442.1`](https://github.com/kamangir/awesome-bash-cli). +built by 🌀 [`blue_options-4.174.1`](https://github.com/kamangir/awesome-bash-cli), based on 🪄 [`abcli-9.443.1`](https://github.com/kamangir/awesome-bash-cli). diff --git a/abcli/.abcli/plugins/actions.sh b/abcli/.abcli/plugins/actions.sh index 909270df..bb352ed2 100644 --- a/abcli/.abcli/plugins/actions.sh +++ b/abcli/.abcli/plugins/actions.sh @@ -2,14 +2,6 @@ function abcli_perform_action() { local options=$1 - - if [ $(abcli_option_int "$options" help 0) == 1 ]; then - local options="action=,plugin=" - abcli_show_usage "@perform_action $options$ABCUL" \ - "perform the action." - return - fi - local action_name=$(abcli_option "$options" action void) local plugin_name=$(abcli_option "$options" plugin abcli) diff --git a/abcli/__init__.py b/abcli/__init__.py index 4e31d399..3f0451b6 100644 --- a/abcli/__init__.py +++ b/abcli/__init__.py @@ -6,7 +6,7 @@ DESCRIPTION = f"{ICON} a language to speak AI." -VERSION = "9.442.1" +VERSION = "9.443.1" REPO_NAME = "awesome-bash-cli" diff --git a/abcli/help/actions.py b/abcli/help/actions.py new file mode 100644 index 00000000..49c634dd --- /dev/null +++ b/abcli/help/actions.py @@ -0,0 +1,21 @@ +from typing import List + +from blue_options.terminal import show_usage, xtra +from abcli.help.generic import help_functions as generic_help_functions + + +def help_perform_action( + tokens: List[str], + mono: bool, +) -> str: + options = "action=,plugin=" + + return show_usage( + [ + "@perform_action", + f"[{options}]", + "", + ], + "perform the action.", + mono=mono, + ) diff --git a/abcli/help/functions.py b/abcli/help/functions.py index 5bdf05d3..b2857f7d 100644 --- a/abcli/help/functions.py +++ b/abcli/help/functions.py @@ -20,6 +20,7 @@ from abcli.help.metadata import help_functions as help_metadata from abcli.help.mlflow import help_functions as help_mlflow from abcli.help.notebooks import help_functions as help_notebooks +from abcli.help.actions import help_perform_action from abcli.help.plugins import help_functions as help_plugins from abcli.help.open import help_open from abcli.help.pause import help_pause @@ -65,6 +66,7 @@ "notebooks": help_notebooks, "open": help_open, "pause": help_pause, + "perform_action": help_perform_action, "plugins": help_plugins, "repeat": help_repeat, "sagemaker": help_sagemaker,