Skip to content

Instantly share code, notes, and snippets.

@rbenito
Last active July 26, 2016 21:47
Show Gist options
  • Save rbenito/25e8bf4ffabb8998051708f45e0c8b07 to your computer and use it in GitHub Desktop.
Save rbenito/25e8bf4ffabb8998051708f45e0c8b07 to your computer and use it in GitHub Desktop.
while [[ $# -gt 0 ]] && [[ ."$1" = .-* ]] ;
do
opt="$1";
shift; #expose next argument
case "$opt" in
"--" ) break 2;;
"-b" )
BRANCH_PATH="$1"; shift;;
"-branch" ) # alternate format
BRANCH_PATH="$1"; shift;;
"-p" )
PORT="$1"; shift;;
"-port" )
PORT="$1"; shift;;
"--help" )
echo "Help?";
exit 0;;
*)
echo "Incorrect Usage";
exit 1;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment