From e918836ab09ef72fca590a5a24279f82779e7c25 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sat, 1 Dec 2018 16:21:31 +0100 Subject: [PATCH] Fix multiple value for getopts (#592) --- data/helpers.d/getopts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/helpers.d/getopts b/data/helpers.d/getopts index 1cc66da8a..6d600e207 100644 --- a/data/helpers.d/getopts +++ b/data/helpers.d/getopts @@ -129,6 +129,8 @@ ynh_handle_getopts_args () { shift_value=$(( shift_value - 1 )) fi + # Declare the content of option_var as a variable. + eval ${option_var}="" # Then read the array value per value for i in `seq 0 $(( ${#all_args[@]} - 1 ))` do @@ -140,8 +142,6 @@ ynh_handle_getopts_args () { break fi else - # Declare the content of option_var as a variable. - eval ${option_var}="" # Else, add this value to this option # Each value will be separated by ';' if [ -n "${!option_var}" ]