#!/bin/dash
#        file: hello_world_debug
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
#     license: GNU General Public License, version 3
# description: example "hello world" script with debug
#     warning: Be aware that the interactive step size in this example is only
#              reasonable to summanrized demonstrate shellia features.
#              Read shellia(7) NOTES, to learn about a reasonable size of
#              interactive steps.
#       usage: ./hello_world_debug [-d <debug-runtime-config>] [-i|-s|-m]
#              Used debug-topics in this script are "none", "start" and "end".
#              Highest debug-leves used in this script is 3.
#              See shellia(1) Debug-mode, to learn about <debug-runtime-config>

# we prefer a local copy of ia, if it exists
[ -f ia ] && . ./ia || . /usr/share/shellia/ia

say_hello_world()
{
    dbg 3 start "say_hello function start" # debug-level=3 debug-topic=start
    echo "hello world"
    dbg 3 end "say_hello function end" # debug-level=3 debug-topic=end
}

eval "$ia_init"
ia_add "dbg \"main program\"" # debug-level=1 debug-topic=none
ia_add say_hello_world
ia
