Merge branch 'dev' of feistymeow.org:feisty_meow into dev
[feisty_meow.git] / infobase / examples / bashisms / example_getops_parsing.txt
1
2 # shell option parsing -- old school version only handles single dash options.
3
4 while getopts "fr:q:a:h" opt; do
5     case "${opt}" in
6         f) force_query=1; ;;
7         r) row_num="${OPTARG}"; ;;
8         q) queue_name="${OPTARG}"; ;;
9         a) alias_name="${OPTARG}"; ;;
10         h) usage 1>&2;  exit ${EX_OK}; ;;
11         ?) usage 1>&2;  exit ${EX_USAGE}; ;;
12     esac
13 done
14
15 shift $(($OPTIND - 1))
16