This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A (toy) language that compiles to bash. You can think of bashup as just a little syntactic sugar sprinkled on top of bash; any valid bash script is also a valid bashup script.

Just a spoonful of sugar makes the bashisms go down…
#!/bin/bash

@fn hi greeting='Hello', target {
    echo "${greeting}, ${target}!"
}

hi --target='World'

Installation:

$ pip install bashup

Compile and run the above example:

$ bashup -i above_example.bashup -o above_example.sh
$ bash above_example.sh
Hello, World!

Or just run it directly:

$ bashup -r above_example.bashup
Hello, World!

Compiled code (above_example.sh):

#!/bin/bash

#
# usage: hi [--greeting=<GREETING>] --target=<TARGET> [ARGS]
#
hi() {
    local greeting='Hello'
    local target
    local target__set=0
    local args=()

    while (( $# )); do
        if [[ "${1}" == --greeting=* ]]; then
            greeting=${1#--greeting=}
        elif [[ "${1}" == --target=* ]]; then
            target=${1#--target=}
            target__set=1
        else
            args+=("${1}")
        fi
        shift
    done

    if ! (( target__set )); then
        echo "[ERROR] The --target parameter must be given."
        return 1
    fi

    __hi "${greeting}" "${target}" "${args[@]}"
}

__hi() {
    local greeting=${1}
    local target=${2}
    shift 2

    echo "${greeting}, ${target}!"
}

hi --target='World'

Supported Bash Versions

The generated bash code works with bash 3.1 and above (tested against 3.1 to 4.3).

Nifty Features

Bashup tries its best to match the indentation of its compiled code against your hand-written bash. For example:

@fn hi greeting='Hello', target {
  echo "${greeting}, ${target}!"
}

…compiles to:

#
# usage: hi [--greeting=<GREETING>] --target=<TARGET> [ARGS]
#
hi() {
  local greeting='Hello'
  local target
  local target__set=0
  local args=()

  while (( $# )); do
    if [[ "${1}" == --greeting=* ]; then
      greeting=${1#--greeting=}
      ...

Planned Improvements

See this document for planned features.

Release History

Release History

2.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

2.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

2.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bashup-2.0.2-py2.py3-none-any.whl (7.8 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jun 1, 2016
bashup-2.0.2.tar.gz (6.6 kB) Copy SHA256 Checksum SHA256 Source Jun 1, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting