Project

General

Profile

« Previous | Next » 

Revision 8865

lib/util.sh: mysql_cmd (): use ${FUNCNAME1} to get the caller's command name instead of requiring the caller to pass the command name explicitly

View differences:

lib/util.sh
190 190
### MySQL
191 191

  
192 192
# auto-adds connection/login opts when specified
193
mysql_cmd () # usage: mysql* () { ...; mysql_cmd "$FUNCNAME" "$@"; }
193
mysql_cmd () # usage: mysql* () { ...; mysql_cmd "$@"; }
194 194
{
195 195
	echo_func "$@"
196
	local cmd="$1"; shift
197 196
	local var=ssh_dest; local_inv
198
	echo_run ${no_ssh_dest:+env }${ssh_dest:+ssh "$ssh_dest" }"$cmd" ${server:+\
199
--host="$server" }${user+--user="$user" }--password${password+="$password"} "$@"
197
	echo_run ${no_ssh_dest:+env }${ssh_dest:+ssh "$ssh_dest" }"${FUNCNAME[1]}" \
198
${server:+ --host="$server" }${user+--user="$user" }\
199
--password${password+="$password"} "$@"
200 200
}
201 201

  
202 202
mysql ()
203 203
{
204 204
	echo_func "$@"
205
	mysql_cmd "$FUNCNAME" --verbose "$@"
205
	mysql_cmd --verbose "$@"
206 206
}
207 207

  
208 208
mysql_ANSI ()

Also available in: Unified diff