diff options
-rw-r--r-- | phpdoc.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/phpdoc.sh b/phpdoc.sh new file mode 100644 index 0000000..e705532 --- /dev/null +++ b/phpdoc.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -u +set -e + +function usage +{ + echo "Usage: $0 -f <function>" +} + +function lookup_function +{ + local name="$1" + + echo "Looking up function $name" +} + +opt_f= + +# Parse the arguments +while getopts :f: opt ; do + case ${opt} in + f) + opt_f="${OPTARG}" + ;; + \?) + echo "Invalid option -${OPTARG}." + exit 1 + ;; + :) + echo "Missing parameter for -${OPTARG}." + exit 1 + ;; + esac +done + +if [ -n "${opt_f}" ]; then + lookup_function "${opt_f}" +else + usage "$0" + exit 1 +fi |