Revision 9098
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
304 | 304 |
func_override() # usage: func_override old_name__suffix |
305 | 305 |
{ from="${1%%__*}" to="$1" copy_func; } |
306 | 306 |
|
307 |
ensure_nested_func() # usage: func__nested_func() { ensure_nested_func; ... } |
|
308 |
{ |
|
309 |
local nested_func="${FUNCNAME[1]}" |
|
310 |
local func="${nested_func%%__*}" |
|
311 |
contains "$func" "${FUNCNAME[@]}" || \ |
|
312 |
die "$nested_func() must be used by $func()" |
|
313 |
} |
|
307 | 314 |
|
315 |
|
|
308 | 316 |
#### commands |
309 | 317 |
|
310 | 318 |
top_script="$0" # outermost script |
Also available in: Unified diff
lib/sh/util.sh: added ensure_nested_func()