#!/bin/sh
{ set +x; } 2>/dev/null

usage() {
    cat <<EOF 1>&2
usage: $(basename $0) command [args]

Available commands:
    create-bucket    create S3 bucket
    create-env       create user with full-access and print env
    upload           upload static/ to S3

run \`$(basename $0) COMMAND --help\` for more infos
EOF
    [ "$1" = "-h" ] || [ "$1" = "--help" ]; exit
}

[ "$1" = "-h" ] || [ "$1" = "--help" ] && usage "$@"

[[ $# == 0 ]] && usage "$@"

"${BASH_SOURCE[0]%/*}"/"${BASH_SOURCE[0]##*/}"-"$1" "${@:2}"
