Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactors #50

Merged
merged 7 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ pip install blue-objects

[![pylint](https://github.com/kamangir/blue-objects/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-objects/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-objects/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-objects/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-objects/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-objects/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-objects.svg)](https://pypi.org/project/blue-objects/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-objects)](https://pypistats.org/packages/blue-objects)

built by 🌀 [`blue_options-4.223.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_objects-5.308.1`](https://github.com/kamangir/blue-objects).
built by 🌀 [`blue_options-4.223.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_objects-5.315.1`](https://github.com/kamangir/blue-objects).

16 changes: 1 addition & 15 deletions blue_objects/.abcli/host.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
#! /usr/bin/env bash

function abcli_host() {
local task=$(abcli_unpack_keyword $1 help)
local task=$(abcli_unpack_keyword $1 void)
local options=$2

if [ "$task" == "help" ]; then
abcli_show_usage "@host get name" \
"get $abcli_host_name."

options="dryrun"
abcli_show_usage "@host reboot [$options]" \
"reboot"

abcli_show_usage "@host shutdown [$options]" \
"shutdown."

return
fi

if [ $task == "get" ]; then
python3 -m blue_options.host \
get \
Expand Down
9 changes: 1 addition & 8 deletions blue_objects/.abcli/mysql.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#! /usr/bin/env bash

function abcli_mysql() {
local task=$(abcli_unpack_keyword $1 help)

if [ "$task" == "help" ]; then
abcli_mysql_cache "$@"
abcli_mysql_tags "$@"
abcli_mysql_relations "$@"
return
fi
local task=$(abcli_unpack_keyword $1 void)

local function_name=abcli_mysql_$task
if [[ $(type -t $function_name) == "function" ]]; then
Expand Down
10 changes: 2 additions & 8 deletions blue_objects/.abcli/object.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ function abcli_clarify_object() {
}

function abcli_object() {
local task=$(abcli_unpack_keyword $1 help)

if [ "$task" == "help" ]; then
abcli_show_usage "abcli object open$ABCUL[.|<object-name>]" \
"open object."
return
fi
local task=$(abcli_unpack_keyword $1 void)

if [ "$task" == "open" ]; then
local object_name=$(abcli_clarify_object $2 .)
Expand All @@ -55,6 +49,6 @@ function abcli_object() {
return
fi

abcli_log_error "-abcli: object: $task: command not found."
abcli_log_error "@object: $task: command not found."
return 1
}
44 changes: 26 additions & 18 deletions blue_objects/.abcli/tests/help.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#! /usr/bin/env bash

function test_blue_objects_help() {
# TODO: enable
return 0

local options=$1

# legacy, not tested:
# - @mysql

local module
for module in \
"@assets" \
Expand All @@ -23,17 +23,20 @@ function test_blue_objects_help() {
"@objects test" \
"@objects test list" \
\
"abcli cache" \
\
"@cp" \
\
"@download" \
\
"@gif" \
\
"abcli host" \
"@host" \
"@host get" \
"@host reboot" \
"@host shutdown" \
\
"abcli metadata" \
"@metadata" \
"@metadata get" \
"@metadata post" \
\
"@mlflow" \
"@mlflow browse" \
Expand All @@ -53,17 +56,22 @@ function test_blue_objects_help() {
"@mlflow test" \
"@mlflow transition" \
\
"abcli mysql" \
"abcli mysql_cache" \
"abcli mysql_relations" \
"abcli mysql_tags" \
\
"abcli object" \
"abcli publish" \
"abcli select" \
"abcli storage" \
"abcli tags" \
"abcli upload" \
"@object" \
"@object open" \
\
"@publish" \
\
"@select" \
\
"@storage" \
"@storage clear" \
"@storage download_file" \
"@storage exists" \
"@storage list" \
"@storage rm" \
"@storage status" \
\
"@upload" \
\
"blue_objects"; do
abcli_eval ,$options \
Expand Down
2 changes: 1 addition & 1 deletion blue_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

DESCRIPTION = f"{ICON} data objects for Bash."

VERSION = "5.308.1"
VERSION = "5.315.1"

REPO_NAME = "blue-objects"

Expand Down
Loading