diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-04-28 16:13:39 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-04-28 16:13:39 (EDT) |
commit | c83659c0a9a7dcdf07f704746714797e35298145 (patch) | |
tree | 5b0dd70b27b3a1ea698eaa022917ec7be4b63048 | |
parent | 1df12b409511675510fe0c1c4583d6b4409c219a (diff) |
get_options(): Don't set illegal options.
Fixes:
$ pro-archman -a
Illegal option -a
eval: 1: opt_?=true: not found
Usage: /usr/bin/pro-archman [<option> ...] <command> [<arg> ...]
[...]
-rw-r--r-- | src/pro-archman.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pro-archman.sh b/src/pro-archman.sh index 62d9461..b4524d2 100644 --- a/src/pro-archman.sh +++ b/src/pro-archman.sh @@ -119,7 +119,9 @@ get_options() unset OPTARG while getopts "${OPTSTRING}" opt; do - eval "opt_${opt}=\"\${OPTARG:-true}\"" + if [ "x${opt}" != 'x?' ]; then + eval "opt_${opt}=\"\${OPTARG:-true}\"" + fi unset OPTARG done |