Improve argument handling

This commit is contained in:
the Sane 2021-01-31 11:33:31 -05:00 committed by GitHub
parent bfc2822a35
commit b22e84887e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1256,9 +1256,9 @@ Usage: lug-helper <options>
# and this setting has no effect
if [ -x "$(command -v zenity)" ]; then
use_zenity="$(echo "$1" | cut -d'=' -f2)"
if [ "$use_zenity" = "yes" ] || [ "$use_zenity" = "YES" ]; then
if [ "$use_zenity" = "yes" ] || [ "$use_zenity" = "YES" ] || [ "$use_zenity" = "1" ]; then
use_zenity=1
elif [ "$use_zenity" = "no" ] || [ "$use_zenity" = "NO" ]; then
elif [ "$use_zenity" = "no" ] || [ "$use_zenity" = "NO" ] || [ "$use_zenity" = "0" ]; then
use_zenity=0
else
printf "$0: Invalid option '$1'\n"
@ -1286,7 +1286,6 @@ Usage: lug-helper <options>
for (( i=0; i<"${#cargs[@]}"; i++ )); do
${cargs[i]}
done
exit 0
fi
fi