Signed-off-by: Martin Schwenke <martin@meltin.net>
local count=$((${node_count[$node_type]:-0} + 1))
node_count[$node_type]=$count
local fmt
local count=$((${node_count[$node_type]:-0} + 1))
node_count[$node_type]=$count
local fmt
- fmt=$(call_func node_name_format "$node_type") || \
- die "Node type \"${node_type}\" not defined!!!"
+ fmt=$(call_func node_name_format "$node_type") || {
+ echo "ERROR: Node type \"${node_type}\" not defined!"
+ echo "Valid node types are:"
+ set | sed -n 's@^node_name_format_\(.*\) ().*@ \1@p'
+ exit 1
+ }
# printf behaves weirdly if given too many args for format, so
# "head" handles the case where there is no %d or similar for
# $count.
# printf behaves weirdly if given too many args for format, so
# "head" handles the case where there is no %d or similar for
# $count.