diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-01-25 15:27:26 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-01-25 16:14:16 +0100 |
commit | 71c549b64d15c2a7b3736f21f65cf6ca4dbb7ee0 (patch) | |
tree | 2c68b088ca799c7cef05c23a886dc175cc5a4ffe | |
parent | cc5474d7efe6845e2f89ac915d6e1289b26044b2 (diff) |
check for getopts before using it
busybox sh doesn't have it and will now display an error.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | fb.in | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -180,6 +180,11 @@ usage: [cat |] `basename "$0"` [switches] [options] [<file(s)|ID(s)|folder(s)>] ! } +if ! type getopts >/dev/null 2>&1; then + echo "Error: getopts is not supported by your shell" >&2 + exit 1 +fi + while getopts "e:gdhHtcv" OPTION; do case $OPTION in e) EXTENSION="$OPTARG";; |