summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-05-01 17:22:05 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-05-01 17:25:33 -0400
commita6ef2ffed4af47ff360bf0fc508aa24e83418f97 (patch)
treeadd4fe52338bb882a945e94465e26221d20b8fc2
parent326e045c879d7ee878dece305b6c5b43dc3a18db (diff)
bugfix [2/2]: librefetch: Correctly fail when given bogus flags
-rwxr-xr-xsrc/librefetch/librefetch7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch
index b0b538e..86986f3 100755
--- a/src/librefetch/librefetch
+++ b/src/librefetch/librefetch
@@ -250,9 +250,10 @@ parse_options() {
long2+=()
# Feed the options through getopt (sanitize them)
- local shrt="$({ printf '%s\0' "${shrt1[@]}"; printf '%s:\0' "${shrt2[@]}"; } | sort -zu | xargs -0 printf '%s')"
- local long="$({ printf '%s\0' "${long1[@]}"; printf '%s:\0' "${long2[@]}"; } | sort -zu | xargs -0 printf '%s,')"
- local args="$(getopt -n "$cmd" -o "$shrt" -l "${long%,}" -- "$@")" || ret=$?
+ local shrt long args
+ shrt="$({ printf '%s\0' "${shrt1[@]}"; printf '%s:\0' "${shrt2[@]}"; } | sort -zu | xargs -0 printf '%s')"
+ long="$({ printf '%s\0' "${long1[@]}"; printf '%s:\0' "${long2[@]}"; } | sort -zu | xargs -0 printf '%s,')"
+ args="$(getopt -n "$cmd" -o "$shrt" -l "${long%,}" -- "$@")" || ret=$?
eval set -- "$args"
unset shrt long args