Establish proper priority of option sources
This commit is contained in:
parent
bc88492ac1
commit
52697be100
6
rowbot
6
rowbot
|
@ -50,12 +50,12 @@ get_option() {
|
|||
local env_var=${var_name^^}
|
||||
|
||||
if [[ ! -v config[$1] || -v OPT_OW ]]; then
|
||||
if [[ -v $var_name ]]; then
|
||||
config[$1]=${!var_name}
|
||||
elif [[ -v $env_var ]]; then
|
||||
if [[ -v $env_var ]]; then
|
||||
config[$1]=${!env_var}
|
||||
elif [[ -v opts[$1] ]]; then
|
||||
config[$1]=${opts[$1]}
|
||||
elif [[ -v $var_name ]]; then
|
||||
config[$1]=${!var_name}
|
||||
elif (( $# > 1 )); then
|
||||
config[$1]=$2
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue