Project

General

Profile

« Previous | Next » 

Revision 8463

lib/util.run: echo_func (): use the caller's FUNCNAME via the $FUNCNAME[] array instead of requiring them to pass it in the function args as `echo_func "$FUNCNAME" "$@"`

View differences:

util.run
11 11

  
12 12
cmd ()
13 13
{
14
	echo_func "$FUNCNAME" "$@"
14
	echo_func "$@"
15 15
	"$(dirname "${BASH_SOURCE[0]}")"/path_relative_to_self
16 16
	"$(dirname "${BASH_SOURCE[1]}")"/path_relative_to_caller
17 17
	"$top_dir"/path_relative_to_outermost_script
......
22 22

  
23 23
echo_run () { echo_cmd "$@"; "$@"; }
24 24

  
25
# usage: echo_func "$FUNCNAME" "$@"
26
echo_func () { echo_cmd "${BASH_SOURCE[1]}:${BASH_LINENO[0]}" "$@"; }
25
# usage: echo_func "$@"
26
echo_func ()
27
{
28
	echo_cmd "${BASH_SOURCE[1]}:${BASH_LINENO[0]}" "${FUNCNAME[1]}" "$@"
29
}
27 30

  
28 31
echo_stdin () { tee -a /dev/stderr; } # usage: input|echo_stdin|cmd
29 32

  
......
42 45

  
43 46
fwd () # usage: subdirs=(...); fwd "$FUNCNAME" "$@"
44 47
{
45
	echo_func "$FUNCNAME" "$@"
48
	echo_func "$@"
46 49
	: "${subdirs?}"
47 50
	
48 51
	for subdir in "${subdirs[@]}"; do
......
52 55

  
53 56
make ()
54 57
{
55
	echo_func "$FUNCNAME" "$@"
58
	echo_func "$@"
56 59
	echo_run env make --directory="$top_dir" "$@"
57 60
}
58 61

  
......
65 68
fi ##
66 69
inline_make ()
67 70
{
68
	echo_func "$FUNCNAME" "$@"
71
	echo_func "$@"
69 72
	(cat
70 73
	cat <<EOF
71 74

  

Also available in: Unified diff