+while getopts "hf:" flag ;do
+ case ${flag} in
+ h)
+ print_usage
+ ;;
+ f)
+ DEST=${OPTARG}
+ ;;
+ ?)
+ echo "${PROG_NAME}: Invalid option: ${OPTARG}."
+ echo "Try \`${PROG_NAME} --help' for more information."
+ exit 1
+ ;;
+ esac
+done
+shift `expr "${OPTIND}" - 1`
+
+# `$#' now represents the number of arguments after the options.
+# `$1' is the first argument, etc.
+if [ ${#} -eq 0 ]; then
+ echo "${PROG_NAME}: Missing source directory."
+ echo "Try \`${PROG_NAME} --help' for more information."
+ exit 1
+elif [ ${#} -gt 1 ]; then
+ echo "${PROG_NAME}: Too many arguments."
+ echo "Try \`${PROG_NAME} --help' for more information."