summaryrefslogtreecommitdiffstats
path: root/lib/getopt.sh
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-10-23 21:44:09 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-10-23 21:44:09 (EDT)
commita89832c82b00a175f7f83fcfb36153176b201065 (patch)
treeb1432dcacb2a324088bb2b9bacdc249322f97163 /lib/getopt.sh
parentdf5eaffb6baaf889c5fd58268bc8c6d7b5997771 (diff)
get_options(): Handle "?" option.
Diffstat (limited to 'lib/getopt.sh')
-rw-r--r--lib/getopt.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/getopt.sh b/lib/getopt.sh
index 537892b..b609a1f 100644
--- a/lib/getopt.sh
+++ b/lib/getopt.sh
@@ -36,7 +36,9 @@ get_options()
unset OPTARG
while getopts "${optstring}" opt; do
- eval "${prefix}${opt}=\"\${OPTARG:-true}\""
+ if [ "x${opt}" != 'x?' ]; then
+ eval "${prefix}${opt}=\"\${OPTARG:-true}\""
+ fi
unset OPTARG
done