Skip to main content

🌀 blue-options

🌀 blue_options implements an options argument for Bash.

here is an example use of an options in the vancouver-watching 🌈 ingest command:

 > @help vanwatch ingest
vanwatch \
	ingest \
	[area=<area>,count=<-1>,~download,dryrun,~upload] \
	[-|<object-name>] \
	[process,count=<-1>,~download,dryrun,gif,model=<model-id>,publish,~upload] \
	[--detect_objects 0] \
	[--overwrite 1] \
	[--verbose 1]

this command takes in an options, an object, and args. an options is a string representation of a dictionary, such as,

area=<vancouver>,~batch,count=<-1>,dryrun,gif,model=<model-id>,~process,publish,~upload

which is equivalent, in json notation, to,

{
    "area": "vancouver",
    "batch": false,
    "count": -1,
    "dryrun": true,
    "gif": true,
    "model": "<model-id>",
    "process": false,
    "publish": true,
    "upload": false,
}

for more refer to 🔻 giza.

installation

pip install blue_options

add this line to your ~/.bash_profile or ~/.bashrc,

source $(python3 -m blue_options locate)/.bash/blue_options.sh

usage

let your function receive an options argument, then parse it with abcli_options and abcli_options_int.

function func() {
    local options=$1

    local var=$(abcli_options "$options" var default)
    local key=$(abcli_options_int "$options" key 0)

    [[ "$key" == 1 ]] &&
        echo "var=$var"
}

example 1

from reddit

How can I automate these tree commands I frequently need to type out? I would like to run:

git add .
git commit -m "Initial "commit"
git push

I got bored of typing them out each time. Can I make an alias or something like "gc" (for git commit). The commit message is always the same "Initial commit".

first, install blue-options. this will also install blueness.

pip install blue_options

then, copy example1.sh to your machine and add this line to the end of your bash_profile,

source <path/to/example1.sh>

now, you have access to the @git super command. here is how it works.

  1. @git help shows usage instructions (see below).
  2. @git commit runs the three commands. you can customize the message by running @git commit <message>. you can also avoid the push by running @git commit <message> ~push.
  3. for any <task> other than commit, @git <task> <args> runs git <task> <args>.
 > @git help
 @git commit [<message>] \
	~push
 . git commit with <message> and push.
@git <command>
 . git <command>.

image


pylint pytest PyPI version PyPI - Downloads

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blue_options-4.240.1.tar.gz (29.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blue_options-4.240.1-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

Details for the file blue_options-4.240.1.tar.gz.

File metadata

  • Download URL: blue_options-4.240.1.tar.gz
  • Upload date:
  • Size: 29.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for blue_options-4.240.1.tar.gz
Algorithm Hash digest
SHA256 07a07ca996f12ee77e21042760a408b8a0a661e6ec0edcf12f6d176816f7700d
MD5 f6c539189207e3fd07222b79ee33330b
BLAKE2b-256 945fb43fc9acc5230bb66931dc29a166d9660c975e50bd144165df3a0d0f5067

See more details on using hashes here.

File details

Details for the file blue_options-4.240.1-py3-none-any.whl.

File metadata

  • Download URL: blue_options-4.240.1-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for blue_options-4.240.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e754adfb4a93349bc1fee7f95b25f727217d21da5cc8a7fcbb686d375170bbda
MD5 96c03ada19b30cd603ce5c18c9e109a4
BLAKE2b-256 e4f82a6612ce5c727fb6e10568dd53e7f6567d893091f105f812cd706ec85b81

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

4.240.1 This release

2 files

4.236.1

2 files

4.234.1

2 files

4.232.1

2 files

4.229.1

2 files

4.227.1

2 files

4.225.1

2 files

4.223.1

2 files

4.221.1

2 files

4.219.1

2 files

4.217.1

2 files

4.215.1

2 files

4.211.1

2 files

4.207.1

2 files

4.205.1

2 files

4.203.1

2 files

4.202.1

2 files

4.200.1

2 files

4.198.1

2 files

4.197.1

2 files

4.194.1

2 files

4.192.1

2 files

4.190.1

2 files

4.189.1

2 files

4.187.1

2 files

4.185.1

2 files

4.180.1

2 files

4.177.1

2 files

4.175.1

2 files

4.174.1

2 files

4.173.1

2 files

4.171.1

2 files

4.170.1

2 files

4.169.1

2 files

4.168.1

2 files

4.167.1

2 files

4.166.1

2 files

4.165.1

2 files

4.164.1

2 files

4.163.1

2 files

4.162.1

2 files

4.161.1

2 files

4.159.1

2 files

4.157.1

2 files

4.156.1

2 files

4.155.1

2 files

4.154.1

2 files

4.153.1

2 files

4.152.1

2 files

4.151.1

2 files

4.150.1

2 files

4.149.1

2 files

4.148.1

2 files

4.147.1

2 files

4.146.1

2 files

4.145.1

2 files

4.144.1

2 files

4.143.1

2 files

4.142.1

2 files

4.135.1

2 files

4.127.1

2 files

4.126.1

2 files

4.125.1

2 files

4.124.1

2 files

4.123.1

2 files

4.122.1

2 files

4.121.1

2 files

4.120.1

2 files

4.119.1

2 files

4.118.1

2 files

4.117.1

2 files

4.116.1

2 files

4.115.1

2 files

4.114.1

2 files

4.113.1

2 files

4.112.1

2 files

4.111.1

2 files

4.110.1

2 files

4.109.1

2 files

4.108.1

2 files

4.107.1

2 files

4.106.1

2 files

4.105.1

2 files

4.104.1

2 files

4.103.1

2 files

4.102.1

2 files

4.101.1

2 files

4.100.1

2 files

4.99.1

2 files

4.98.1

2 files

4.97.1

2 files

4.96.1

2 files

4.95.1

2 files

4.94.1

2 files

4.93.1

2 files

4.92.1

2 files

4.91.1

2 files

4.90.1

2 files

4.89.1

2 files

4.88.1

2 files

4.87.1

2 files

4.86.1

2 files

4.85.1

2 files

4.84.1

2 files

4.83.1

2 files

4.82.1

2 files

4.81.1

2 files

4.80.1

2 files

4.76.1

2 files

4.73.1

2 files

4.70.1

2 files

4.69.1

2 files

4.68.1

2 files

4.67.1

2 files

4.66.1

2 files

4.65.1

2 files

4.64.1

2 files

4.63.1

2 files

4.45.1

2 files

4.43.1

2 files

4.42.1

2 files

4.41.1

2 files

4.40.1

2 files

4.39.1

2 files

4.38.1

2 files

4.37.1

2 files

4.36.1

2 files

4.35.1

2 files

4.34.1

2 files

4.33.1

2 files

4.32.1

2 files

4.31.1

2 files

4.30.1

2 files

4.29.1

2 files

4.28.1

2 files

4.27.1

2 files

4.26.1

2 files

4.23.1

2 files

4.22.1

2 files

4.21.1

2 files

4.20.1

2 files

4.12.1

2 files

4.8.1

2 files

4.7.1

2 files

4.6.1

2 files

4.5.1

2 files

4.4.1

2 files

4.3.1

2 files

4.2.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page