Skip to content

Instantly share code, notes, and snippets.

@mcustiel
Created June 5, 2019 11:30
Show Gist options
  • Save mcustiel/fec82e67a7cb202f7b31e8fd5f1f0e4a to your computer and use it in GitHub Desktop.
Save mcustiel/fec82e67a7cb202f7b31e8fd5f1f0e4a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
set -o
YES="1"
NO="0"
EMPTY=""
FORCE_DB_INSTALL=${NO}
BRANCH=${EMPTY}
while getopts "fb:" option; do
case ${option} in
f)
FORCE_DB_INSTALL=${YES}
;;
b)
BRANCH=${OPTARG}
;;
\?)
echo "Invalid option -${OPTARG}." 1>&2
exit 1
;;
:)
echo "Invalid option: ${OPTARG} requires an argument." 1>&2
exit 1
;;
esac
done
shift $((OPTIND -1))
echo ${FORCE_DB_INSTALL}
echo ${BRANCH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment