parse options

This commit is contained in:
Vincent Riquer 2013-02-27 22:45:53 +01:00
parent 194c707172
commit 81e7fa9bf6

41
atom Normal file → Executable file
View File

@ -1,7 +1,44 @@
#!/bin/bash
#parse arguments
OPTERR=0
while getopts ':c:l:T:F:hD' opt
do
case $opt in
c)
cffile="$OPTARG"
;;
l)
cliload="$OPTARG"
;;
T)
cliltimer="$OPTARG"
;;
F)
forceall+=("$OPTARG")
;;
h)
help
exit 0
;;
D)
(( debug++ ))
;;
:)
echo "-$OPTARG requires an argument"
help
exit 127
;;
*)
echo "Unrecognized option: -$OPTARG"
help
exit 127
;;
esac
done
#parse config
#check sanity
getFiles() {
@ -71,7 +108,7 @@ checkLoad() {
readUserInput() {
#read + / - / q(uit) / p(ause)
#initiate shutdown / check load threshold / SIGSTOP all children / SIGCONT all children
#initiate shutdown / change load threshold / SIGSTOP all children / SIGCONT all children
:
}
@ -90,4 +127,4 @@ transcodeLauncher() {
#UI
# vim:set ts=8,sw=8:
# vim:set ts=8 sw=8: