mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
commit
ebaa16da3d
1 changed files with 11 additions and 0 deletions
|
@ -154,6 +154,15 @@ ynh_handle_getopts_args () {
|
|||
fi
|
||||
# Escape double quote to prevent any interpretation during the eval
|
||||
all_args[$i]="${all_args[$i]//\"/\\\"}"
|
||||
# Escape $ as well to prevent the string following it to be seen as a variable.
|
||||
all_args[$i]="${all_args[$i]//$/\\\$}"
|
||||
|
||||
# For the record.
|
||||
# We're using eval here to get the content of the variable stored itself as simple text in $option_var...
|
||||
# Other ways to get that content would be to use either ${!option_var} or declare -g ${option_var}
|
||||
# But... ${!option_var} can't be used as left part of an assignation.
|
||||
# declare -g ${option_var} will create a local variable (despite -g !) and will not be available for the helper itself.
|
||||
# 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]}\"
|
||||
shift_value=$(( shift_value + 1 ))
|
||||
|
@ -195,6 +204,8 @@ ynh_handle_getopts_args () {
|
|||
|
||||
# Escape double quote to prevent any interpretation during the eval
|
||||
arguments[$i]="${arguments[$i]//\"/\\\"}"
|
||||
# Escape $ as well to prevent the string following it to be seen as a variable.
|
||||
arguments[$i]="${arguments[$i]//$/\\\$}"
|
||||
|
||||
# Store each value given as argument in the corresponding variable
|
||||
# The values will be stored in the same order than $args_array
|
||||
|
|
Loading…
Add table
Reference in a new issue