blob: 87c77cdcc3da890b64d211c4eba76e7ea3f28cff [file] [log] [blame]
#!/usr/bin/env bash
options_prefix() { # array_name option_name
local array_name=$1
local array_elements_name=$array_name[@]
local option=$2
local items=("${!array_elements_name}")
local item
eval "$array_name=()"
for item in "${items[@]}"; do
eval "$array_name"'+=("$option" "$item")'
done
}