Project

General

Profile

« Previous | Next » 

Revision 13247

fix: lib/sh/util.sh: echo_vars(): also need to print unset vars (including unset kw_params)

View differences:

trunk/lib/sh/util.sh
742 742

  
743 743
## vars
744 744

  
745
echo_vars() # usage: echo_vars var... # only prints vars that are defined
745
echo_vars() # usage: echo_vars var... # also prints unset vars
746 746
{
747 747
	log_local; log++ # same log_level as echo_func
748 748
	if can_log; then
749 749
		local var; for var in "${@%%=*}"; do
750
			if isset "$var"; then log "$(declare -p "$var")"; fi
750
			if ! isset "$var"; then declare "$var"='<unset>'; fi
751
			log "$(declare -p "$var")"
751 752
		done
752 753
	fi
753 754
}

Also available in: Unified diff