This patch allows to run scripts which use gsu with bash's -u option
enabled. This is mostly useful to spot bugs due to typos in variable
names.
for ((i=0; i < ${#gsu_options[@]}; i++)); do
eval "${gsu_options[$i]}"
- eval val='"'\$$name'"'
+ eval val='"'\${${name}:-}'"'
eval orig_${gsu_config_var_prefix}_$name='"'${val}'"'
done
eval orig_val='"'\$orig_${gsu_config_var_prefix}_$name'"'
if [[ -z "$orig_val" ]]; then
- eval val='"'\$$name'"'
+ eval val='"'\${$name:-}'"'
else
val="$orig_val"
fi
_gsu_print_available_commands()
{(
- local i count
+ local i count=0
gsu_short_msg "Available commands:"
for i in $gsu_cmds; do
printf "$i"
_gsu_get_command_regex
ere="$result"
- if test -z "$1"; then
+ if (($# == 0)); then
_gsu_banner_msg 2>&1
_gsu_usage 2>&1
{
for ((i=0; i < ${#1}; i++)); do
c1=${1:$i:1}
c2=${1:$(($i + 1)):1}
- result+=" o_$c1"
+ result+=" o_$c1="
if [[ "$c2" = ":" ]]; then
let i++
else
- result+="=false"
+ result+="false"
fi
done
result+="