Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9751117274
Fetching contributors…

Cannot retrieve contributors at this time

executable file 41 lines (34 sloc) 1.141 kb
#!/bin/bash
START_TIME=$SECONDS
VERBOSE=0
EXE=`basename "$BASH_SOURCE"`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
usage()
{
echo "usage: $EXE [OPTIONS]"
echo "options:"
# Custom options are the first block shown
echo " -x PARAM An example option that requires a parameter"
# Common options are the last black shown
echo ""
echo " -h Shows this message and quits"
echo " -v Raises verbose level (repeat for more; max TBD)"
exit 1
}
while getopts ":hvx:" opt
do
case $opt in
# Basic -h and -v
h ) usage;;
v ) let VERBOSE=VERBOSE+1;;
# Custom handlers
x ) echo "I am option -x. I was given \"$OPTARG\".";;
# Error-handlers
\?) echo "Invalid option: -$OPTARG" >&2; exit 1;;
: ) echo "Option -$OPTARG requires an argument." >&2; exit 1;;
esac
done
# Script body ##########################################################
# Script body ##########################################################
ELAPSED_TIME=$(($SECONDS - $START_TIME))
if [ $VERBOSE -gt 0 ]; then echo "$EXE finished executing in $(($ELAPSED_TIME/60)) min, $(($ELAPSED_TIME%60)) sec"; fi
Jump to Line
Something went wrong with that request. Please try again.