Signed-off-by: Martin Schwenke <martin@meltin.net>
cat <<EOF
commands:
+ base [ create | boot ] ...
+
+ cluster create
+
create base
create a base image
usage_smart_display load_config
}
+actions_init ()
+{
+ actions=""
+}
+
+actions_add ()
+{
+ actions="${actions}${actions:+ }$*"
+}
+
+actions_run ()
+{
+ [ -n "$actions" ] || usage
+
+ local a
+ for a in $actions ; do
+ $a
+ done
+}
+
######################################################################
post_config_hooks=
shift
case "$t" in
+ base)
+ actions_init
+ for t in "$@" ; do
+ case "$t" in
+ create|boot) actions_add "base_${t}" ;;
+ *) usage ;;
+ esac
+ done
+ actions_run
+ ;;
+
+ cluster)
+ actions_init
+ for t in "$@" ; do
+ case "$t" in
+ create) actions_add "cluster_${t}" ;;
+ *) usage ;;
+ esac
+ done
+ actions_run
+ ;;
+
create)
t="$1"
shift