Fix getopts with empty parameters

This commit is contained in:
Maniack Crudelis 2020-04-21 16:24:49 +02:00
parent 7cc04f5171
commit f72be82429

View file

@ -147,6 +147,9 @@ ynh_handle_getopts_args () {
break
fi
else
# Ignore empty parameters
if [ -n "${all_args[$i]}" ]
then
# Else, add this value to this option
# Each value will be separated by ';'
if [ -n "${!option_var}" ]
@ -166,6 +169,7 @@ ynh_handle_getopts_args () {
# So... Stop fucking arguing each time that eval is evil... Go find an other working solution if you can find one!
eval ${option_var}+='"${all_args[$i]}"'
fi
shift_value=$(( shift_value + 1 ))
fi
done