Skip to content

Commit

Permalink
release + help refactor - kamangir/bolt#746
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Nov 6, 2024
1 parent 562a34e commit 810ff45
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.149.1`](https://github.com/kamangir/awesome-bash-cli), based on 🪄 [`abcli-9.403.1`](https://github.com/kamangir/awesome-bash-cli).
built by 🌀 [`blue_options-4.150.1`](https://github.com/kamangir/awesome-bash-cli), based on 🪄 [`abcli-9.404.1`](https://github.com/kamangir/awesome-bash-cli).
20 changes: 0 additions & 20 deletions abcli/.abcli/plugins/repeat.sh

This file was deleted.

9 changes: 9 additions & 0 deletions abcli/.abcli/tests/eval.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /usr/bin/env bash

function test_abcli_eval() {
abcli_eval - ls
abcli_assert "$?" 0

abcli_eval - lsz
abcli_assert "$?" 0 not
}
6 changes: 4 additions & 2 deletions abcli/.abcli/tests/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ function test_abcli_help() {
"@plugins list_of_installed" \
"@plugins transform" \
\
"abcli_sleep" \
"@repeat" \
\
"@sleep" \
\
"@terraform" \
"@terraform cat" \
"@terraform disable" \
"@terraform enable" \
\
"abcli_watch" \
"@watch" \
\
"abcli"; do
abcli_eval ,$options \
Expand Down
9 changes: 9 additions & 0 deletions abcli/.abcli/tests/repeat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /usr/bin/env bash

function test_abcli_repeat() {
abcli_repeat - ls
abcli_assert "$?" 0

abcli_repeat count=3 ls
abcli_assert "$?" 0
}
2 changes: 1 addition & 1 deletion abcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

DESCRIPTION = f"{ICON} a language to speak AI."

VERSION = "9.403.1"
VERSION = "9.404.1"

REPO_NAME = "awesome-bash-cli"

Expand Down
25 changes: 25 additions & 0 deletions abcli/help/eval.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from typing import List

from blue_options.terminal import show_usage, xtra


def options(mono: bool):
return xtra(
"dryrun,~log,path=<path>",
mono=mono,
)


def help_eval(
tokens: List[str],
mono: bool,
) -> str:
return show_usage(
[
"@eval",
f"[{options(mono=mono)}]",
"<command-line>",
],
"eval <command-line>.",
mono=mono,
)
4 changes: 4 additions & 0 deletions abcli/help/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from abcli.help.cp import help_cp
from abcli.help.docker import help_functions as help_docker
from abcli.help.download import help_download
from abcli.help.eval import help_eval
from abcli.help.gif import help_gif
from abcli.help.git import help_functions as help_git
from abcli.help.gpu import help_functions as help_gpu
Expand All @@ -13,6 +14,7 @@
from abcli.help.notebooks import help_functions as help_notebooks
from abcli.help.plugins import help_functions as help_plugins
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.sleep import help_sleep
from abcli.help.terraform import help_functions as help_terraform
Expand All @@ -24,6 +26,7 @@
"cp": help_cp,
"docker": help_docker,
"download": help_download,
"eval": help_eval,
"gif": help_gif,
"git": help_git,
"gpu": help_gpu,
Expand All @@ -35,6 +38,7 @@
"notebooks": help_notebooks,
"plugins": help_plugins,
"pytest": help_pytest,
"repeat": help_repeat,
"sagemaker": help_sagemaker,
"sleep": help_sleep,
"terraform": help_terraform,
Expand Down
27 changes: 27 additions & 0 deletions abcli/help/repeat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from typing import List

from blue_options.terminal import show_usage

from abcli.help.eval import options as eval_options


def help_repeat(
tokens: List[str],
mono: bool,
) -> str:
options = "".join(
[
"count=<count>,",
eval_options(mono=mono),
]
)

return show_usage(
[
"@repeat",
f"[{options}]",
"<command-line>",
],
"repeat <command-line>.",
mono=mono,
)
9 changes: 7 additions & 2 deletions abcli/help/watch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
from typing import List

from blue_options.terminal import show_usage
from blue_options.terminal import show_usage, xtra


def help_watch(
tokens: List[str],
mono: bool,
) -> str:
options = "~clear,dryrun,seconds=<seconds>"
options = "".join(
[
xtra("~clear,dryrun,", mono=mono),
"seconds=<seconds>",
]
)

return show_usage(
[
Expand Down

0 comments on commit 810ff45

Please sign in to comment.