Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Nov 3, 2024
1 parent 87eadd4 commit e690a33
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 19 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.148.1`](https://github.com/kamangir/awesome-bash-cli), based on 🪄 [`abcli-9.390.1`](https://github.com/kamangir/awesome-bash-cli).
built by 🌀 [`blue_options-4.148.1`](https://github.com/kamangir/awesome-bash-cli), based on 🪄 [`abcli-9.391.1`](https://github.com/kamangir/awesome-bash-cli).
16 changes: 3 additions & 13 deletions abcli/.abcli/modules/terraform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
function abcli_terraform() {
local task=$(abcli_unpack_keyword $1)

if [ "$task" == "help" ]; then
abcli_show_usage "abcli terraform" \
"terraform this machine."
abcli_show_usage "abcli terraform cat" \
"cat terraform files."
abcli_show_usage "abcli terraform disable" \
"disable terraform."
abcli_show_usage "abcli terraform enable" \
"enable terraform."
return
fi

if [ "$task" == "cat" ]; then

if [[ "$abcli_is_mac" == true ]]; then
Expand Down Expand Up @@ -57,7 +45,9 @@ function abcli_terraform() {
return
fi

if [[ "$abcli_is_headless" == false ]] && [[ "$abcli_is_mac" == false ]] && [[ "$abcli_is_docker" == false ]]; then
if [[ "$abcli_is_headless" == false ]] &&
[[ "$abcli_is_mac" == false ]] &&
[[ "$abcli_is_docker" == false ]]; then
rm $abcli_path_ignore/background*
local background_image=$abcli_path_ignore/background-$(abcli_string_timestamp).jpg

Expand Down
1 change: 1 addition & 0 deletions abcli/.abcli/plugins/alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
alias @=abcli

alias @T=abcli_terraform
alias @terraform=abcli_terraform

alias @act=abcli_perform_action
alias @action=abcli_perform_action
Expand Down
5 changes: 5 additions & 0 deletions abcli/.abcli/tests/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ function test_abcli_help() {
\
"@init" \
\
"@terraform" \
"@terraform cat" \
"@terraform disable" \
"@terraform enable" \
\
"abcli"; do
abcli_eval ,$options \
abcli_help $module
Expand Down
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.390.1"
VERSION = "9.391.1"

REPO_NAME = "awesome-bash-cli"

Expand Down
6 changes: 2 additions & 4 deletions abcli/help/functions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from typing import List

from blue_options.terminal import show_usage, xtra

from abcli.help.cp import help_cp
from abcli.help.download import help_download
from abcli.help.gif import help_gif
Expand All @@ -13,6 +9,7 @@
from abcli.help.mlflow import help_functions as help_mlflow
from abcli.help.notebooks import help_functions as help_notebooks
from abcli.help.pytest import help_pytest
from abcli.help.terraform import help_functions as help_terraform


help_functions = {
Expand All @@ -27,4 +24,5 @@
"mlflow": help_mlflow,
"notebooks": help_notebooks,
"pytest": help_pytest,
"terraform": help_terraform,
}
68 changes: 68 additions & 0 deletions abcli/help/terraform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
from typing import List

from blue_options.terminal import show_usage, xtra


def help_(
tokens: List[str],
mono: bool,
) -> str:
return show_usage(
[
"@terraform",
],
"terraform this machine.",
mono=mono,
)


def help_cat(
tokens: List[str],
mono: bool,
) -> str:
return show_usage(
[
"@terraform",
"cat",
],
"cat terraform files.",
mono=mono,
)


def help_disable(
tokens: List[str],
mono: bool,
) -> str:
return show_usage(
[
"@terraform",
"disable",
],
"disable terraform.",
mono=mono,
)


def help_enable(
tokens: List[str],
mono: bool,
) -> str:
options = "actions|repo"

return show_usage(
[
"@terraform",
"enable",
],
"enable terraform.",
mono=mono,
)


help_functions = {
"": help_,
"cat": help_cat,
"disable": help_disable,
"enable": help_enable,
}

0 comments on commit e690a33

Please sign in to comment.